Author |
Message
|
apizarro |
Posted: Mon Jun 09, 2014 10:31 am Post subject: How can i get the value of a SOAP Header Element. |
|
|
Newbie
Joined: 09 Jun 2014 Posts: 1
|
Hi everyone.
I need some help!!!. I need to get an element from SOAP Header. I have this sentence in the compute node:
DECLARE CHANNEL CHARACTER InputRoot.SOAP.ns3:Header.ns:ClientInfo.ns:CMM_MetaData.ns:Channel;
The problem is, CHANNEL Variable doesn't get the value from the SOAP Header. The XML Message is the following.
Code: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webapi.lombardisoftware.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Header>
<web:ClientInfo>
<web:CMM_MetaData>
<web:Channel>Web</web:Channel>
</web:CMM_MetaData>
<web:TimeZone>-04:00</web:TimeZone>
<web:Locale>en-US</web:Locale>
<web:AcceptsTimeZone>true</web:AcceptsTimeZone>
<!--Optional:-->
<!--Optional:-->
<web:SafelyIgnoresExtraXml>true</web:SafelyIgnoresExtraXml>
</web:ClientInfo>
</soapenv:Header> |
Can some body to help me?
Thanks a lot! |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 09, 2014 10:49 am Post subject: Re: How can i get the value of a SOAP Header Element. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
apizarro wrote: |
Can some body to help me? |
What are the values of ns3 & ns in your ESQL? How do they match up with the namespaces in your document as shown by a trace (as distinct from the namespaces you believe are in use)? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jun 09, 2014 10:52 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you use USERTRACE the output will show you the element number where the
problem lies.
Then you can resolve it and move onto the next one.
IMHO, far easier than the debugger but I am sure that others will disagree but at least it tells you where the problem lies. _________________ 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 |
|
 |
McueMart |
Posted: Tue Jun 10, 2014 12:43 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Quote: |
IMHO, far easier than the debugger but I am sure that others will disagree but at least it tells you where the problem lies. |
Well the debugger would be far easier if it was enhanced to display namespaces *looks at the development team hopefully*.
As for OPs problem - IIRC, when you reference the SOAP header, you dont need to namespace it (although I cant see why it would hurt...).
So can you try:
InputRoot.SOAP.Header.ns:ClientInfo ...etc |
|
Back to top |
|
 |
aggarwal.intouch |
Posted: Fri Jun 13, 2014 4:14 am Post subject: |
|
|
 Acolyte
Joined: 30 May 2011 Posts: 56 Location: India
|
Debugging would be the best to traverse through the complete path and no need to mention namespace with header. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 13, 2014 4:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
aggarwal.intouch wrote: |
Debugging would be the best to traverse through the complete path and no need to mention namespace with header. |
So not true. You may not need to mention the SOAP envelope namespace, but all other namespaces still apply AFAIK...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Esa |
Posted: Fri Jun 13, 2014 5:35 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
"May" is not the correct word here but "must".
I think that if you set a namespace to Header, the SOAP parser will not find it. And the same is true with Body. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 13, 2014 8:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Esa wrote: |
"May" is not the correct word here but "must".
I think that if you set a namespace to Header, the SOAP parser will not find it. And the same is true with Body. |
The SOAP parser does not let you use the SOAP Envelope namespace as it is implied and known to the parser. Somebody should check if this is still valid if you have to cater both for SOAP V1.1 and SOAP V1.2 headers...
Don't know about any other namespaces that you could skip (wsse,wsa, and any other namespace that can be found on the header's children or the body are still required...) _________________ MQ & Broker admin |
|
Back to top |
|
 |
Esa |
Posted: Sat Jun 14, 2014 1:42 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
fjb_saper wrote: |
The SOAP parser does not let you use the SOAP Envelope namespace as it is implied and known to the parser. Somebody should check if this is still valid if you have to cater both for SOAP V1.1 and SOAP V1.2 headers...
|
I think this is exactly the reason why SOAP.Header and SOAP.Body cannot have namespaces. Because the namespaces are different for SOAP.1.1 and SOAP 1.2. You set the version in SOAP.Context.SOAP_Version. This is how you can easily handle both versions. |
|
Back to top |
|
 |
|