ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How can i get the value of a SOAP Header Element.

Post new topic  Reply to topic
 How can i get the value of a SOAP Header Element. « View previous topic :: View next topic » 
Author Message
apizarro
PostPosted: Mon Jun 09, 2014 10:31 am    Post subject: How can i get the value of a SOAP Header Element. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Jun 09, 2014 10:49 am    Post subject: Re: How can i get the value of a SOAP Header Element. Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Mon Jun 09, 2014 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
McueMart
PostPosted: Tue Jun 10, 2014 12:43 am    Post subject: Reply with quote

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
View user's profile Send private message
aggarwal.intouch
PostPosted: Fri Jun 13, 2014 4:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Fri Jun 13, 2014 4:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Esa
PostPosted: Fri Jun 13, 2014 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 13, 2014 8:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Esa
PostPosted: Sat Jun 14, 2014 1:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How can i get the value of a SOAP Header Element.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.