Author |
Message
|
chris boehnke |
Posted: Thu Feb 23, 2012 12:02 pm Post subject: soap message |
|
|
 Partisan
Joined: 25 Jul 2006 Posts: 369
|
Hi Guys,
I am trying to add soap header to the a webservice request using ESQL. I am using the below code.
Quote: |
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.SOAP.soapenv:Envelope.soapenv:Header.trackID = 'sidjowjeopiwp'; |
When i am add the declaration for soap envelope it is coming twice in my output.
The below is the output iam getting
Quote: |
<SOAP_Domain_Msg>
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Header>
<trackID>sidjowjeopiwp</trackID>
</NS1:Header>
<NS1:Body>
.
.
. |
I am expecting something like this
Quote: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header><trackID>sidjowjeopiwp</trackID>
</soapenv:Header> |
Can you guys pls help me. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 23, 2012 12:31 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Have you read this page in the info center?
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac67194_.htm
When you do this...
Code: |
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; |
...you are making your ESQL neater.
Let me say that again, in case you didn't get it the first time:
When you do this...
Code: |
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; |
...you are making your ESQL neater.
Please note that an ESQL NAMESPACE constant does *not* affect the way in which the XMLNSC parser converts the message tree to an XML document. It does not cause an xmlns attribute to appear in the output XML. If you want to do that then the page that I've quoted above will explain how to do it. |
|
Back to top |
|
 |
chris boehnke |
Posted: Thu Feb 23, 2012 6:32 pm Post subject: |
|
|
 Partisan
Joined: 25 Jul 2006 Posts: 369
|
kimbert wrote: |
Have you read this page in the info center?
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac67194_.htm
When you do this...
Code: |
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; |
...you are making your ESQL neater.
Let me say that again, in case you didn't get it the first time:
When you do this...
Code: |
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; |
...you are making your ESQL neater.
Please note that an ESQL NAMESPACE constant does *not* affect the way in which the XMLNSC parser converts the message tree to an XML document. It does not cause an xmlns attribute to appear in the output XML. If you want to do that then the page that I've quoted above will explain how to do it. |
Thanks Kimbert. I am able to generate soap message as I expected.
But, when I tried to call the webservice, i am getting error message as
"No Soap.Body found".
can you guys throw some light? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Feb 24, 2012 5:40 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 25, 2012 4:45 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Hi Chris,
Looks like this is the first time you are using the SOAP parser.
Think of the SOAP parser as generating anything above and including the soapenv:Body tag for you. So you would have
OutputRoot.SOAP.ns:xmltoptag....
So all the stuff you tried to put into the Soap header needs to go into the Local environment as overrides...
You might want to look at the samples and read up on the node in the documentation...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mgk |
Posted: Sun Feb 26, 2012 6:56 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
OutputRoot.SOAP.ns:xmltoptag.... |
Almost. The SOAP domain does take care of the SOAPVersion (1.1 or 1.2) so you don't have to. However, headers are the body are both stored under the SOAP parser, so you have:
Code: |
OutputRoot.SOAP.Header.ns:myheader = xxx |
or
Code: |
OutputRoot.SOAP.Body.ns:myBody = xxx |
This is explained better here: http://www.ibm.com/developerworks/webservices/library/ws-soapnode2/
Kind 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 |
|
 |
fjb_saper |
Posted: Sun Feb 26, 2012 10:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Thanks mgk for the correction and the right reference  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|