|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Facing multiple name space declaration issue in the soapresp |
« View previous topic :: View next topic » |
Author |
Message
|
manojreddy524 |
Posted: Fri Feb 03, 2017 11:23 pm Post subject: Facing multiple name space declaration issue in the soapresp |
|
|
Novice
Joined: 19 Apr 2016 Posts: 12
|
Hi friends,
My soap response contains multiple name space declarations , for every array element it is creating new declaration. please guide me to resolve this issue.
Following are my response and also esql code.
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Header>
<NS2:subHeader xmlns:NS2="http://www.abc.com">
<NS2:RequestUUID>a</NS2:RequestUUID>
</NS2:subHeader>
</NS1:Header>
<NS1:Body>
<NS3:getAcctDetailsResponse xmlns:NS3="http://www.abc.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<NS3:matchFound>TRUE</NS3:matchFound>
<NS3:operAccID>
<NS3:billID>020FIDB070078</NS3:billID>
<NS3:billAmountAndCurrency>42138!USD</NS3:billAmountAndCurrency>
</NS3:operAccID>
</NS3:getAcctDetailsResponse>
<NS4:getAcctDetailsResponse xmlns:NS4="http://www.abc.com">
<NS4:operAccID>
<NS4:billID>020FIDB070079</NS4:billID>
<NS4:billAmountAndCurrency>36618!USD</NS4:billAmountAndCurrency>
</NS4:operAccID>
</NS4:getAcctDetailsResponse>
CREATE FIELD OutputRoot.SOAP.Body.ns142:getAcctDetailsResponse;
DECLARE operResultSet REFERENCE TO Environment.Variables.operResultSet;
DECLARE targetCursor1 REFERENCE TO OutputRoot.SOAP.Body.ns142:getAcctDetailsResponse;
IF count1 > 0 THEN
SET targetCursor1.ns142:matchFound = 'TRUE';
WHILE LASTMOVE(operResultSet) DO
SET targetCursor1.ns142:operAccID.ns142:billID = operResultSet.BILL_ID;
SET targetCursor1.ns142:operAccID.ns142:billAmountAndCurrency = operResultSet.BILLAMT;
MOVE operResultSet NEXTSIBLING REPEAT TYPE NAME;
IF LASTMOVE(operResultSet) THEN
CREATE NEXTSIBLING OF targetCursor1 AS targetCursor1 REPEAT;
END IF;
END WHILE; |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Feb 04, 2017 12:18 am Post subject: Re: Facing multiple name space declaration issue in the soap |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
This
Code: |
<NS3:getAcctDetailsResponse xmlns:NS3="http://www.abc.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
and this
Code: |
<NS4:getAcctDetailsResponse xmlns:NS4="http://www.abc.com">
|
shows clearly that NS3 and NS4 are identical. This means that the XML that would be generated is valid. You did check the SOAP message in a validator didn't you?
This means that and decent XML Parser will not throw its toys out of the pram and give an error.
Please tell us why you can't accept what you are seeing.
This question has been asked before here (at least twice). Why not use the google search feature (upper Right of the page) and see what you can find.
If the destination of this message can't parse it, then it might be that they are using a custom parser for XML. Very rare these days. _________________ 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 |
|
 |
manojreddy524 |
Posted: Sat Feb 04, 2017 1:11 am Post subject: Hi |
|
|
Novice
Joined: 19 Apr 2016 Posts: 12
|
Hi smdavies99 ,
Thank you for yors response.
Here i am not getting any error , but my question is that why the namespace is declaring and changing for every array set ?
Here NS1 and NS2 are already declared so why again its creating NS3,Ns4.....like this it is creating
Code: |
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS2:subHeader xmlns:NS2="http://www.abc.com">
<NS4:getAcctDetailsResponse xmlns:NS4="http://www.abc.com">
<NS4:operAccID>
<NS4:billID>020FIDB070079</NS4:billID>
<NS4:billAmountAndCurrency>36618!USD</NS4:billAmountAndCurrency>
</NS4:operAccID>
</NS4:getAcctDetailsResponse>
<NS5:getAcctDetailsResponse xmlns:NS5="http://www.abc.com">
<NS5:operAccID>
<NS5:billID>020FIBC00000802</NS5:billID>
<NS5:billAmountAndCurrency>47360!USD</NS5:billAmountAndCurrency>
</NS5:operAccID>
</NS5:getAcctDetailsResponse>
<NS6:getAcctDetailsResponse xmlns:NS6="http://www.abc.com">
<NS6:operAccID>
<NS6:billID>020FIBC021080</NS6:billID>
<NS6:billAmountAndCurrency>61818.13!USD</NS6:billAmountAndCurrency>
</NS6:operAccID>
</NS6:getAcctDetailsResponse> |
Last edited by manojreddy524 on Sun Feb 05, 2017 9:21 am; edited 2 times in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Feb 05, 2017 8:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And the response has been given multiple times as well.
If you don't want each namespace declaration to create a new namespace identifier you will need to create the namespace declaration in ESQL like
Code: |
create ref.(NamespaceDecl)app1 = 'http://app1.org'; |
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|