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 » XML Payload in Web Service reply

Post new topic  Reply to topic
 XML Payload in Web Service reply « View previous topic :: View next topic » 
Author Message
stephendl
PostPosted: Tue Jul 26, 2005 2:22 am    Post subject: XML Payload in Web Service reply Reply with quote

Newbie

Joined: 26 Jul 2005
Posts: 7

All

I have a problem with a web service reply. I am calling the web service using a HTTP Request node and the service works fine and replies with a message.

The problem is that the payload of the response is XML, and I cannot persuade the broker to read it as XML rather than a simple string containing the markup.

Eg. The response looks like this:

Code:
(
  (0x01000000):Properties         = (
    (0x03000000):MessageSet      = ''
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 546
    (0x03000000):CodedCharSetId  = 1208
    (0x03000000):Transactional   = FALSE
    (0x03000000):Persistence     = FALSE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-07-25 14:49:36.993'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):HTTPResponseHeader = (
    (0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 200 OK'
    (0x03000000):X-Original-HTTP-Status-Code = 200
    (0x03000000):Server                      = 'WebSphere Application Server/5.1'
    (0x03000000):Content-Type                = 'text/xml; charset=utf-8'
    (0x03000000):Content-Language            = 'en-GB'
    (0x03000000):Connection                  = 'close'
  )
  (0x01000010):XML                = (
    (0x05000018):XML              = (
      (0x06000011): = '1.0'
      (0x06000012): = 'utf-8'
    )
    (0x06000002):                 = '
'
    (0x01000000):soapenv:Envelope = (
      (0x03000000):xmlns:soapenv  = 'http://schemas.xmlsoap.org/soap/envelope/'
      (0x03000000):xmlns:soapenc  = 'http://schemas.xmlsoap.org/soap/encoding/'
      (0x03000000):xmlns:xsd      = 'http://www.w3.org/2001/XMLSchema'
      (0x03000000):xmlns:xsi      = 'http://www.w3.org/2001/XMLSchema-instance'
      (0x01000000):soapenv:Header =
      (0x01000000):soapenv:Body   = (
        (0x01000000):getMyDataResponse = (
          (0x03000000):xmlns                      = 'http://test'
          (0x01000000):getMyDataReturn = (
            (0x02000000): = '<DATA>
        <SUBDATA1>325442004</SUBDATA1>
        <SUBDATA2>
                <SUBSUBDATA2 id="858811000001104">
                        <TEXT>Some Info</TEXT>
                </SUBSUBDATA2>
        </SUBDATA2>
</DATA>'
          )
        )
      )
    )
  )
)


So I cannot address the fields <DATA> or its subfields, I can only extract the whole thing as a string.

Has anybody got any ideas of what I may be doing wrong, or how to do it better?

Thanks in advance.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 26, 2005 3:30 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It might be helpful to see the raw XML coming back, instead of the parsed data. It might not be what you're doing, it might be what the replier is doing.

You can certainly extract the text field and then use Create Field .... Parse... to turn it into a logical message tree.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
stephendl
PostPosted: Tue Jul 26, 2005 6:47 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2005
Posts: 7

Jeff

Thanks for the reply.

I have managed to get the raw XML coming back from the web service call and it seems you are right. Here is what I'm getting:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><getMyDataResponse xmlns="http://test"><getMyDataReturn>&lt;DATA&gt;
&lt;SUBDATA1&gt;325442004&lt;/SUBDATA1&gt;
        &lt;SUBDATA2&gt;
                &lt;SUBSUBDATA2 id="858811000001104"&gt;
                        &lt;TEXT&gt;Some Info&lt;/TEXT&gt;
                &lt;/SUBSUBDATA2&gt;
        &lt;/SUBDATA2&gt;
&lt;/DATA&gt;</getMyDataReturn></getMyDataResponse></soapenv:Body></soapenv:Envelope>


So the application server generating the reply (WAS) is escaping the < and > characters.

I'll try the
Code:
Create Field .... Parse...
suggestion and see if I can't get that working.

Otherwise I'll have to go and kick WAS!

Cheers again.


Last edited by stephendl on Tue Jul 26, 2005 7:16 am; edited 2 times in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 26, 2005 6:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

stephendl wrote:
So the application server generating the reply (WAS) is escaping the < and > characters.


As a WAS admin, allow me to suggest that it's probably not WAS that's doing this...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
stephendl
PostPosted: Tue Jul 26, 2005 7:01 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2005
Posts: 7

I agree - I meant kick the code that I have written in WAS for the web service

Do you mind if I ask you a WAS related question then? I don't mind taking it to a different forum if you have a preference.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 26, 2005 7:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

stephendl wrote:
Do you mind if I ask you a WAS related question then?
You can ask...

I might not know the answer.

stephendl wrote:
I don't mind taking it to a different forum if you have a preference.


I think we've been putting WAS questions in Java/JMS.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
stephendl
PostPosted: Tue Jul 26, 2005 7:19 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2005
Posts: 7

Cheers

Carried on here: http://www.mqseries.net/phpBB2/viewtopic.php?t=23390
Back to top
View user's profile Send private message
Empeterson
PostPosted: Tue Jul 26, 2005 7:30 am    Post subject: Reply with quote

Centurion

Joined: 14 Apr 2003
Posts: 125
Location: Foxboro, MA

I had this exact same issue and solved the problem quite nicely with Jeff's suggestion, although you might have to cast the string into a blob before the CREATE ... PARSE. Not sure if that is a necessary step or not, but it is something that I did in my code.
_________________
IBM Certified Specialist: MQSeries
IBM Certified Specalist: Websphere MQ Integrator
Back to top
View user's profile Send private message Send e-mail AIM Address
stephendl
PostPosted: Fri Jul 29, 2005 12:50 am    Post subject: Reply with quote

Newbie

Joined: 26 Jul 2005
Posts: 7

Cheers guys. I used the CREATE... PARSE... and it worked a treat.
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 » XML Payload in Web Service reply
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.