Posted: Mon Jul 13, 2015 7:27 am Post subject: order the elements with schema
Partisan
Joined: 25 Jul 2006 Posts: 369
Hi All,
We are using WMB v 8.0.0.2.
Here is the brief description of what I am doing.
1. Request from client is received on MQ queue.
2. WMB builds the request to call webservice,
3. Call the webservice.
4. Transform the webservice response.
5. sends reply back to client
The transformation is not straight forward. For few fields we should be creating the element tag based on the response element value.
Quote:
Eg: Response XML from webservice
<benefitname>inNetworkRetailDrugGenericPreferredCopay</benefitname>
Client response to be created.
<inNetworkRetailDrugGenericPreferredCopay>{value}</inNetworkRetailDrugGenericPreferredCopay>
Code:
I am creating the node like this
OutputRoot.XMLNSC.PlanResponse.xxx.yyy.zzz.{benefitname}
The order of the benefits is not guranteed. Can I make sure order of the benefits matches the client response by create parse with message set statement after builing the response .
Can I make sure order of the benefits matches the client response by create parse with message set statement after builing the response
No - if you use ESQL then the message tree is built in the order of the ESQL statements.
This question crops up from time to time. At one time, there was no good answer except 'write your ESQL to match the schema'. Since v8, you have some better options:
- use a JavaCompute node, and specify that you want to use JAXB.
- use a Mapping node
Both of those will build the output message tree in schema order. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum