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 » Extracting values from SOAP Header

Post new topic  Reply to topic
 Extracting values from SOAP Header « View previous topic :: View next topic » 
Author Message
pottas
PostPosted: Tue Dec 18, 2007 4:16 am    Post subject: Extracting values from SOAP Header Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

Guys,
I am running the following configuration on Windows(XP) :
Message Broker Toolkit: 6.0.2, Interim Fix 8
Message Broker: MQSI 6.0.0.5

I have an HTTP Input Node, configured to use the XMLNSC Parser that accepts the following message:
Code:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rbac="http://contracts.it.nednet.co.za/services/common-services/2008-06-14/RBAC">
   <soapenv:Header>
      <context:EnterpriseContext xmlns:context="http://contracts.it.nednet.co.za/Infrastructure/2006-11-01/EnterpriseContext">
         <context:ExecutionContextID>14809BCF-88A2-BBB2-E066-96B90AAF9EF1</context:ExecutionContextID>
         <context:SourceInfo>
            <context:ChannelID>0</context:ChannelID>
         </context:SourceInfo>
         <context:SecurityInfo>
            <context:Ticket>
               <context:Identity>5066551195</context:Identity>
               <context:AuthenticationLOC>0</context:AuthenticationLOC>
               <context:SessionSequenceNr>1215</context:SessionSequenceNr>
               <context:ExpiryDateTime>2007-11-22T22:30:32.994Z</context:ExpiryDateTime>
               <context:IdentifierType>PSI</context:IdentifierType>
               <context:TicketSignature>5FA4DEB27381EA3C584F3B3B0763255DBCF9676C</context:TicketSignature>
            </context:Ticket>
         </context:SecurityInfo>
         <context:InstrumentationInfo>
            <context:InstrumentationContextID>ECF2B338-6742-7423-E42F-0EC51F31F6AE</context:InstrumentationContextID>
         </context:InstrumentationInfo>
      </context:EnterpriseContext>
   </soapenv:Header>
   <soapenv:Body>
      <rbac:RBACOperationAddRq>
         <rbac:Operation>
            <rbac:BusinessObjectName>RBAC</rbac:BusinessObjectName>
            <rbac:OperationName>RBAC2</rbac:OperationName>
         </rbac:Operation>
         <rbac:Validation>RBAC3</rbac:Validation>
      </rbac:RBACOperationAddRq>
   </soapenv:Body>
</soapenv:Envelope>


In my Compute Node, I want to extract the values from the incoming header, i.e. 'ExecutionContextID' and 'Identity', etc. and build it into a Cobol output message. But for now I'm just battling to get the values extracted - so I get 'Nothing' returned from the following Procedure:
Code:

      CREATE PROCEDURE GetValues() BEGIN
            SET OutputRoot.XML.MyMsg.MyData1 = COALESCE(InputRoot.XMLNSC.Envelope.Header.EnterpriseContext.ExecutionContextID,'Nothing');
            SET OutputRoot.XML.MyMsg.MyData2 = COALESCE(InputRoot.XMLNSC.Envelope.Header.EnterpriseContext.SecurityInfo.Ticket.Identity,'Nothing');
      END


...So how do I get to the values of my tags? I suppose it has something to do with the namespaces.

Thanks in advance
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 18, 2007 4:22 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Please don't use the XML Domain.

Even on output.

Yes, your problem is that you aren't using namespaces to address the elements in your input tree.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Dec 18, 2007 4:23 am    Post subject: Re: Extracting values from SOAP Header Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi pottas,
pottas wrote:
...So how do I get to the values of my tags? I suppose it has something to do with the namespaces.
Something....it has everything to do with your namespaces

Search the forum for DECLARE NAMESPACE...you should find relevant snippets of code.

Regards.
Back to top
View user's profile Send private message Send e-mail
pottas
PostPosted: Tue Dec 18, 2007 11:10 pm    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

Thanks guys, I did some reading and searching and consulting and I got to my answer - Elvis, thanks, I see you're right - it is all about declaring Namespaces ...

Jeff, the reason for using the XML domain as input is to pick up the Root element tag to use in a CASE statement:
Quote from Kimbert:
Quote:
You cannot access the name of the root tag from ESQL if you are using the MRM domain for your XML messages. I suggest that you change your flow to use the XMLNSC domain. Or at least the XMLNS domain.

My XML OutputRoot is just used to test for now. Ultimately I want to map these values to a COBOL structure.

I want to thank you guys for a brilliant forum - it helps a lot!

pottas
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Dec 19, 2007 7:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can get at the root tag just as easily from the XMLNSC parser as the XML Parser.
_________________
I am *not* the model of the modern major general.
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 » Extracting values from SOAP Header
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.