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 with Soap

Post new topic  Reply to topic
 XML with Soap « View previous topic :: View next topic » 
Author Message
gagan.maverick
PostPosted: Fri Jan 29, 2016 3:22 am    Post subject: XML with Soap Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hi Guys i have a message whose structure is
<?xml version="1.0" encoding="UTF-8"?>
-<soapenv:Envelope xmlns:glob="http://sap.com/xi/APPL/Global2" xmlns:urn="urn:amarfood:ERP:Global" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">-<soapenv:Body>
<Nmamaam>
<MessageHeader>


Now the comes in mqinput node whose parser is XMLNSC i have selected , but not able to access MessageHeader filed.

Any suggestions.

I tried this

InputRoot.XMLNSC."soapenv:Envelope"."soapenv:Body".(XMLNSC.Element)*.MessageHeader[1];
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 29, 2016 5:37 am    Post subject: Re: XML with Soap Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

gagan.maverick wrote:
I tried this

InputRoot.XMLNSC."soapenv:Envelope"."soapenv:Body".(XMLNSC.Element)*.MessageHeader[1];


Why the double quotes?

If we assume soapenv is correctly declared in your ESQL (and if it's not, I've found your problem) then why not try:

Code:
InputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.Nmamaam.MessageHeader[1];


or

Code:

DECLARE whereisheader REFERENCE TO InputRoot.XMLNSC;
MOVE whereisheader to InputRoot.XMLNSC.soapenv:Envelope.soapenv:Body;
MOVE whereisheader FIRSTCHILD TYPE XMLNSC.Element;
MOVE whereisheader REPEAT;


or put the message through SOAPExtract node and deal with the payload as normal XML

or read the message with a SOAPInput node configured to use JMS instead of an MQInput node

or

...

or

..
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Fri Jan 29, 2016 9:04 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hi

Thanks for the reply , but can you tell me , how to declare soapenv i guess that would be the ideal approach.

I guess
Declare ns namespace something of that sort
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 29, 2016 9:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

"soapenv" is a namespace prefix.

You can use whatever prefix you want, it doesn't have to be "soapenv". It just has to point to the correct namespace.

You are otherwise spending a fair amount of time avoiding things that would make it much easier. That is, all the suggestions made by my esteemable colleague.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Fri Jan 29, 2016 9:44 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hi ,
I tried this
DECLARE ns NAMESPACE 'http://sap.com/xi/APPL/Global2';
DECLARE REFIN_MSG REFERENCE TO InputRoot.XMLNSC.ns:Envelope.ns:Body;

still doesn't seem to work.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 29, 2016 9:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

gagan.maverick wrote:

I tried this
DECLARE ns NAMESPACE 'http://sap.com/xi/APPL/Global2';
DECLARE REFIN_MSG REFERENCE TO InputRoot.XMLNSC.ns:Envelope.ns:Body;

still doesn't seem to work.


Really? You sound surprised. I'd be astonished if the Envelope or Body elements were in the http://sap.com/xi/APPL/Global2 namespace.

That's based on my knowledge of the format of a soap message and the XML you yourself posted earlier!

Now that randomly half following one of my suggestions hasn't worked, how about thinking about what I suggested, why I suggested it and coming up with a plan?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Fri Jan 29, 2016 10:37 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hi,
DECLARE tns NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE REFIN_MSGHEADER REFERENCE TO InputRoot.XMLNSC.tns:Envelope.tns:Body.(XMLNSC.Element)*.MessageHeader[1];


This worked, thanks guys
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Jan 29, 2016 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.

You could work it out for yourself.

The FIELDNAME and FIELDNAMESPACE functions could provide the tools you need to dig down into the message tree.
It requires some work but I've used this before when a message had more than 10 different namespaces. Finding the namespace of an element from the actual message tree unlocked the door.
_________________
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
mqjeff
PostPosted: Mon Feb 01, 2016 7:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

A simple trace of the message tree (trace node, either to a file or to the usertrace (probably a better choice...)) will show you all of the namespace information you need.
_________________
chmod -R ugo-wx /
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 with Soap
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.