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 » Parsing SOAP message

Post new topic  Reply to topic
 Parsing SOAP message « View previous topic :: View next topic » 
Author Message
j2soccer
PostPosted: Tue May 22, 2007 5:57 pm    Post subject: Parsing SOAP message Reply with quote

Newbie

Joined: 21 May 2007
Posts: 5

Hi,

For SOAP message I know it is better to use XMLNS/XMLNSC parser. I just want to try to use XML parser and I know this doesn't sounds the best a good effort. But for my curiosity, how to retrieve part of the InputRoot so i can get value of 'firstName' here:

here is the ecxcerpt of the trace msg:

Code:
  (0x01000010):XML             = (
    (0x05000018):XML              = (
      (0x06000011): = '1.0'
      (0x06000012): = 'UTF-8'
    )
    (0x01000000):soapenv:Envelope = (
      (0x03000000):xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
      (0x03000000):xmlns:xsd     = 'http://www.w3.org/2001/XMLSchema'
      (0x03000000):xmlns:xsi     = 'http://www.w3.org/2001/XMLSchema-instance'
      (0x01000000):soapenv:Body  = (
        (0x01000000):shipPartRequest = (
          (0x03000000):xmlns        = 'http://www.acmeOrders.com/ShippingService'
          (0x01000000):partNo       = (
            (0x03000000):xmlns = ''
            (0x02000000):      = '123'
          )
          (0x01000000):partQuantity = (
            (0x03000000):xmlns = ''
            (0x02000000):      = '0'
          )
          (0x01000000):personName   = (
            (0x03000000):xmlns     = ''
            (0x01000000):firstName = (
              (0x02000000): = 'mark'
            )
            (0x01000000):lastName  = (
              (0x02000000): = 'white'
            )
          )
          (0x01000000):address      = (
            (0x03000000):xmlns   = ''
            (0x01000000):street  = (
              (0x02000000): = '1234'
            )
            (0x01000000):city    = (
              (0x02000000): = 'new york'
            )
            (0x01000000):zipCode = (
              (0x02000000): = '456000'
            )
          )
        )
      )
    )
  )


I can get the value using this way; -- OK

Code:
FIELDVALUE(InputRoot.XML.(XML.Element)[0].(XML.Element)[0].(XML.Element)[0].(XML.Element)[1]);


But it is kind of too complex. I would like to see this kind of code but this code doesn't work --Not OK

FIELDVALUE
Code:
(InputRoot.XML.Envelope.Body.shipPartRequest.personName.firstName*[0])

I appreciate you reply.
Back to top
View user's profile Send private message
j2soccer
PostPosted: Tue May 22, 2007 5:58 pm    Post subject: Reply with quote

Newbie

Joined: 21 May 2007
Posts: 5

Sorry the last statement should be like this

Code:
FIELDVALUE(InputRoot.XML.Envelope.Body.shipPartRequest.personName.firstName*[0])
Back to top
View user's profile Send private message
mgk
PostPosted: Tue May 22, 2007 7:34 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi.

For the life of me I can't see why you want to do this, but seeing as you do, look more closely at the trace node output:

(0x01000000):soapenv:Envelope

A (0x01000000) type element is a NAME element, so the name of this element is not Envelope it is 'soapenv:Envelope' so this is the name you should use (in quotes) in your field reference when accessing this element. This will also apply to the body and to any other element that is namespace qualified.

Therefore in this case it will look something like (untested):

Code:
FIELDVALUE(InputRoot.XML."soapenv:Envelope"."soapenv:Body".shipPartRequest.personName.firstName);


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
j2soccer
PostPosted: Tue May 22, 2007 8:35 pm    Post subject: Reply with quote

Newbie

Joined: 21 May 2007
Posts: 5

That code work. Thanks MGK. Actually I was just kind of curious into how to parse message using different parser. I get it working for all XML parser but this one (InputRoot.XML). I did try your solution but without 'quote's.

Again appreciate your reply. I give you 10 points.
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 » Parsing SOAP message
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.