Author |
Message
|
agrawalamit166 |
Posted: Fri Oct 09, 2015 1:07 pm Post subject: XML format to Structured String conversion at runtime |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
Hi,
wanted to check, can we do dynamic conversion from XML format to Structured String. means if we get xml message as an input, then at run time, we will select the Structured string template (based upon template identifier details in request message) and generate the Structured string.
IIB version using: IIB V10.0.0.1
Thanks. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 09, 2015 10:59 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
What do you mean by 'StructuredString'?
An example may well help. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 12, 2015 5:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you can map from the "template identifier details" to the name of a root element in a DFDL message definition, then you will have instructed IIB which message set to use. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Mon Oct 12, 2015 12:04 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
smdavies99 wrote: |
What do you mean by 'StructuredString'?
An example may well help. |
Request message Example:
Quote: |
<Employee>
<FirstName>FNAME</FirstName>
<LastName>LNAME</LastName>
<Salary>2000.30</Salary>
</Employee>
|
Scenario 1:
Quote: |
Template 1 Details:
<Employee>
<FirstName length="10" type="String"></FirstName>
<LastName length="10" type="String"></LastName>
<Salary length="10" type="Number" precision="2"></Salary>
</Employee>
Response 1:
Code: |
"FNAME LNAME 00002000.30" |
|
Scenario 2:
Quote: |
Template 2 Details:
<Employee>
<FirstName length="10" type="String"></FirstName>
<Salary length="10" type="Number" precision="2"></Salary>
<LastName length="10" type="String"></LastName>
</Employee>
Response 2:
Code: |
"FNAME 00002000.30LNAME " |
|
[/code]
Hope, this will give you clear idea. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 12, 2015 12:05 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
agrawalamit166 wrote: |
Response 1:
Code: |
"FNAME LNAME 00002000.30" |
|
So a DFDL message. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Mon Oct 12, 2015 12:06 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
mqjeff wrote: |
If you can map from the "template identifier details" to the name of a root element in a DFDL message definition, then you will have instructed IIB which message set to use. |
We will try this approach and update you soon (if we have very specific templates).... |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Mon Oct 12, 2015 12:07 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
mqjeff wrote: |
agrawalamit166 wrote: |
Response 1:
Code: |
"FNAME LNAME 00002000.30" |
|
So a DFDL message. |
yes, But we need to send DFDL message Dynamically based upon template design. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 12, 2015 12:09 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
agrawalamit166 wrote: |
mqjeff wrote: |
agrawalamit166 wrote: |
Response 1:
Code: |
"FNAME LNAME 00002000.30" |
|
So a DFDL message. |
yes, But we need to send DFDL message Dynamically based upon template design. |
Yes. I mentioned a method. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Mon Oct 12, 2015 12:18 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
We are still discussing on this:
So far we have two approaches:
Quote: |
Using Java code:
For dynamic template, we should be able to achieve it by java code to look each attribute inside the element, but this approach is good only for basic structure. This will be difficult, if we need to look nested element in template. |
Quote: |
Using DFDL:
If we have very specific template then DFDL approach should be good, we should be able to implement it easily. But if templates are changing very frequently then it be difficult to maintain. |
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 12, 2015 12:22 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You need to really analyze how often you expect your message formats to actually change.
If you're careful in how you build your message definitions, you can construct your DFDL messages such that you can just assign the input XML document tree to the output DFDL tree. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
agrawalamit166 |
Posted: Mon Oct 12, 2015 12:33 pm Post subject: |
|
|
 Voyager
Joined: 17 Aug 2009 Posts: 78 Location: NY, US
|
Thanks mqjeff,
mqjeff wrote: |
You need to really analyze how often you expect your message formats to actually change.
|
i am trying to get this details.
mqjeff wrote: |
If you're careful in how you build your message definitions, you can construct your DFDL messages such that you can just assign the input XML document tree to the output DFDL tree. |
I believe: this requires code change, deployment effort, which again depends upon how frequently message format is changing. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 13, 2015 4:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The other thing to think about is
"How complicated will the templates need to be" ?
If they are simply a matter of "Field A goes to Field 2, Field B goes to Field 1" and etc, then you could even just use a string (in a table property on a node).
But if your templates start having to make decisions based on data. Then that's really *code* and not *template*.
In v10 at least you can use shared libraries and only update and redeploy those. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|