Author |
Message
|
kumar.MBMQ |
Posted: Mon Jan 20, 2014 7:07 am Post subject: retrieving the soap body from environment variable |
|
|
Voyager
Joined: 06 May 2011 Posts: 93
|
I have one composite service which calls three services.
each time after getting the soap response it stores in environment variable.
like
env.var1= soap.body1;
environment.var2=soap.body2.
is it possible to store the soap body in environment and retrieve the body.
will the value in environment takes care of namespaces which are in soap.body ?
SET Environment.Variables2.ResponseBody.CustAcctListRes=InputRoot.SOAP.Body;
SET OutputRoot.SOAP.Body.ns25:CustomerProfileAggregateRes.ns25:CustShortDtlInqRes.ns25:CustInfo.CustomerID=Environment.Variables1.ResponseBody.CustShortDetailsInquiryRes.custinfo.custid
SET OutputRoot.SOAP.Body.ns25:CustomerProfileAggregateRes.ns25:CustShortDtlInqRes.ns25:CustInfo.Mnemonic=Environment.Variables1.ResponseBody.CustShortDetailsInquiryRes.CustInfo.mnemonic
SET OutputRoot.SOAP.Body.ns25:CustomerProfileAggregateRes.ns25:CustShortDtlInqRes.ns25:CustInfo.PersonInfo.ShortName=Environment.Variables1.ResponseBody.CustShortDetailsInquiry.PersonInfo.ShortName;
will the above code work? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 20, 2014 7:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you park something in the environment tree be aware that you need to assign it a parser first. By default the environment tree has no parser assigned and this will lead you to some surprises and gotchas...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dogorsy |
Posted: Mon Jan 20, 2014 8:33 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
yes, as fjb_saper said, associate a parser to the tree. And also, use REFERENCEs to avoid those horribly long SET statements and improve performance and readability |
|
Back to top |
|
 |
kumar.MBMQ |
Posted: Mon Jan 20, 2014 9:18 am Post subject: |
|
|
Voyager
Joined: 06 May 2011 Posts: 93
|
Thanks for your reply but
I have written statement like .
CREATE LASTCHILD OF Environment.Variables1.ResponseBody1 DOMAIN('XMLNSC') PARSE(X ENCODING 0 CCSID 0);
I am not sure ,What have to write in the place of X ?
I want to write some thing like this
SET Environment.Variables1.ResponseBody1 .XMLNSC = InputRoot.soap.Body;
let me know if I am wrong ?
thanks, |
|
Back to top |
|
 |
dogorsy |
Posted: Mon Jan 20, 2014 10:03 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
kumar.MBMQ wrote: |
Thanks for your reply but
I have written statement like .
CREATE LASTCHILD OF Environment.Variables1.ResponseBody1 DOMAIN('XMLNSC') PARSE(X ENCODING 0 CCSID 0);
I am not sure ,What have to write in the place of X ?
I want to write some thing like this
SET Environment.Variables1.ResponseBody1 .XMLNSC = InputRoot.soap.Body;
let me know if I am wrong ?
thanks, |
You do not need the PARSE clause in the CREATE, but you need a NAME clause.
In the set you do not need the .XMLNSC
There are examples in the infocenter |
|
Back to top |
|
 |
|