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 » SOAP Envelop

Post new topic  Reply to topic
 SOAP Envelop « View previous topic :: View next topic » 
Author Message
kash3338
PostPosted: Wed Feb 23, 2011 2:17 am    Post subject: SOAP Envelop Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

How do i set the namespace in Comput Node for the SOAP Envelop node to set that in the Soap message?

When i tried setting the following,

SET OutputLocalEnvironment.SOAP.Envelope.(XMLNSC.NamespaceDecl)xmlns oapenv = soapenv;
SET OutputLocalEnvironment.SOAP.Envelope.(XMLNSC.NamespaceDecl)xmlns:xsi = xsi;
SET OutputLocalEnvironment.SOAP.Envelope.(XMLNSC.NamespaceDecl)xmlns oapenc = soapenc;

I get the following error,
"A message using an incorrect parser (MQROOT) was detected in node: SOAPEnvelope"
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Wed Feb 23, 2011 2:32 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Something like this maybe?
Code:

DECLARE nsSoap          NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
      CREATE LASTCHILD OF OutputRoot AS outRef DOMAIN('XMLNSC');      
      CREATE LASTCHILD OF outRef AS outRef NAMESPACE nsSoap NAME 'Envelope';
        SET outRef.(XMLNSC.NamespaceDecl)xmlns:nsSoap = nsSoap;
etc
etc
etc
CREATE LASTCHILD OF outRef AS outRef NAMESPACE nsSoap NAME 'Body';



I'm using the above to set some properties in the Envelope. Otherwise, you could let the SOAP Node do it for you...
_________________
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
kash3338
PostPosted: Wed Feb 23, 2011 3:30 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

If that is the case wont there be two Envelop's created as the SOAP Reaply by defaullt creates ne Evnvelop on its own.

So the problem tat we are facing is that, two Envelop's are getting created.
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Feb 23, 2011 3:32 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

If you are using the XMLNSC domain then what smdavies99 says makes sense.

However, if you are using the SOAP domain (and if you are using the SOAP nodes you should use the SOAP domain) then you do NOT create the Envelope as the SOAP nodes in conjunction with the SOAP domain parser do this for you. To control what version of SOAPEnvelope they create you can set fields in the SOAP.Context section. So to set the SOAP version for example, you can do this:

Code:
SET OutputRoot.SOAP.Context.SOAP_Version = '1.2';

or
Quote:
SET OutputRoot.SOAP.Context.SOAP_Version = '1.1';


You should only need to set the above if WSDL is not used (so the SOAP nodes are in Gateway mode) or the WSDL says version 1.1 and you need to send a message that is in version 1.2 (or vice versa) and do not want to change the WSDL.

To control the namespaces and prefixes used used by the SOAP domain in the envelope, you can see an example in a thread that was on this forum a couple of days ago that I posted to as well.

Note that you should not use the SOAPEnvelope node with the SOAP domain (or with other SOAP nodes). I know this is a little confusing, but the SOAPEnvelope node is designed for use with the HTTP nodes which do not automatically create the SOAP Envelope for you.


I hope this helps,

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
View user's profile Send private message
kash3338
PostPosted: Wed Feb 23, 2011 4:21 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

I am using the SOAP nodes and i dont hve the SOAP Envelop node in my flow now. I have set the NAMESPACE for the <soap:envelop> tag in my Compute node before the SOAP Reply node.

The problem is, since the SOAP Reply node also creates a <soap:envelop> tag, there are two such tags and hence there are two <soap:body> tags as well.

I need to set the NAMESPACE for my soap:envelop tag. How do i do that?
Back to top
View user's profile Send private message Send e-mail
kash3338
PostPosted: Wed Feb 23, 2011 4:26 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

I am using the SOAP nodes and i dont hve the SOAP Envelop node in my flow now. I have set the NAMESPACE for the <soap:envelop> tag in my Compute node before the SOAP Reply node.

The problem is, since the SOAP Reply node also creates a <soap:envelop> tag, there are two such tags and hence there are two <soap:body> tags as well.

I need to set the NAMESPACE for my soap:envelop tag. How do i do that?
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Feb 23, 2011 4:30 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Can you post the code you are using and an example of the output please?
_________________
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
smdavies99
PostPosted: Wed Feb 23, 2011 4:37 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

As you having trouble with the SOAP Reply Node

AND

you are seeing TWO Envelopes

THEN could it be that one of them is the Envelope that was part of the incoming message?
After the SOAP Input Node did you put the message through a SOAPExtract Node.
This is pretty common practice...
If the first envelope is not correctly formatted then simply delete it. (set it to NULL).
_________________
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
kash3338
PostPosted: Wed Feb 23, 2011 5:00 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

mgk wrote:
Can you post the code you are using and an example of the output please?


The code in ESQL is,

DECLARE ns2 NAMESPACE 'http://ftp.planisware.com/DataService';
DECLARE soapenc NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding';
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope';
DECLARE encodingStyle NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding';
DECLARE schemaLocation NAMESPACE 'http://xml.netbeans.org/schema/Server_Requestdate';
DECLARE xsd NAMESPACE 'http://www.w3.org/2001/XMLSchema';

SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:soapenv = soapenv;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:xsi = xsi;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:soapenc = soapenc;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:encodingStyle = encodingStyle;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:ns2 = ns2;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:xsd = xsd;

The output tht we get is,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding" xmlns:ns2="http://ftp.planisware.com/DataService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope" xmlns:encodingStyle="http://schemas.xmlsoap.org/soap/encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns2:Answer xmlns:ns2="http://xml.netbeans.org/schema/Client_Commiteddate">OK</ns2:Answer>
</soapenv:Body>
</soapenv:Envelope>
</soapenv:Body>
</soapenv:Envelope>

There are two "soapenv:Envelope" and "soapenv:Body" in this.
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Feb 23, 2011 5:51 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

OK, so what is happening here is that your namespace declaration for the SOAP 1.1 envelope is wrong. So the SOAPReply node, looks for a valid SOAP envelope and does not find one, so it wraps your message (which is actually not a valid SOAP message) with an envelope that is an envelope that is valid SOAP.

You need to change this:

Code:
DECLARE soapenc NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding';

to this:

Code:
DECLARE soapenc NAMESPACE 'http://schemas.xmlsoap.org/soap/encoding/';


And then think about using the SOAP domain instead of XMLNSC for the SOAP nodes...

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.


Last edited by mgk on Wed Feb 23, 2011 6:36 am; edited 1 time in total
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Feb 23, 2011 5:57 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Those contact admin trailing '/' are a right PITA. Some namespaces have them and some don't....

_________________
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
kash3338
PostPosted: Wed Feb 23, 2011 6:00 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

Thanks a lot for your help mgk.

We had a XML declaration at the beginning and it worked fine now, we set the following declaration,

SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration) = '';
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration).(XMLNSC.Attribute)Version = '1.0';
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration).(XMLNSC.Attribute)Encoding = 'UTF-8';
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP Envelop
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.