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 » Using SOAP Extract and SOAP envelope nodes

Post new topic  Reply to topic Goto page 1, 2  Next
 Using SOAP Extract and SOAP envelope nodes « View previous topic :: View next topic » 
Author Message
mqxplorer
PostPosted: Fri Aug 28, 2009 11:57 am    Post subject: Using SOAP Extract and SOAP envelope nodes Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi All,

I am trying to make use of SOAP Extract and SOAP Envelope nodes in a message flow project. I have two message flows. In the first message flow, I would like to take off the SOAP envelope using SOAP extract node and want to send the message (without soap env) to the second flows as request message(same queue is configured on the MQOutput node of first flow and MQInput node of second flow). I would like to re-add the SOAP envelope to the message in the second flow using SOAPEnvelope node which I extracted in the first flow. How can I get the extracted SOAP envelope in the first flow to the second flow? Is it possible or we can use the extracted SOAP envelope only in the same flow?

Thanks in advance.
Back to top
View user's profile Send private message
ovasquez
PostPosted: Fri Aug 28, 2009 4:59 pm    Post subject: Re: Using SOAP Extract and SOAP envelope nodes Reply with quote

Centurion

Joined: 09 Dec 2005
Posts: 141
Location: Lima, Peru

mqxplorer wrote:
Hi All,

I am trying to make use of SOAP Extract and SOAP Envelope nodes in a message flow project. I have two message flows. In the first message flow, I would like to take off the SOAP envelope using SOAP extract node and want to send the message (without soap env) to the second flows as request message(same queue is configured on the MQOutput node of first flow and MQInput node of second flow). I would like to re-add the SOAP envelope to the message in the second flow using SOAPEnvelope node which I extracted in the first flow. How can I get the extracted SOAP envelope in the first flow to the second flow? Is it possible or we can use the extracted SOAP envelope only in the same flow?

Thanks in advance.

Yes is posibled, alternatives:
1. Use internal queue, in flow1 put soap header in queue internal and flow2 get soap header
2. Pass soap header with part in message flow1 -->flow2
_________________
Oscar Vásquez Flores
Back to top
View user's profile Send private message Send e-mail
mqxplorer
PostPosted: Sat Aug 29, 2009 8:08 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi ovasquez,

Thanks for the reply. I have tried to implement the first method you suggested, however, I could not succeed. When the message is passed through the SOAP extract node the message coming out of the out terminal has no SOAP envelope which is what it is supposed to be, however, my question is, how can I store the header seperately in a queue, as I am giving SOAP envelope destination as "$Environment/SOAP/Envelope" on the SOAP Extract node properties. If we store it in a queue, can we get it in a second flow using MQGet node?Thanks.


Last edited by mqxplorer on Mon Aug 31, 2009 6:29 am; edited 1 time in total
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Sat Aug 29, 2009 8:16 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

The environment contents will be lost between flow invocations which leads to me think you have two real options:
1) merge the flows
2) Pass the Soap envelope in the message to the second flow.

I'd avoid doing the extra work with intermediate queues as this just makes the solution uneccesarily messy.
Back to top
View user's profile Send private message
ovasquez
PostPosted: Sat Aug 29, 2009 8:26 am    Post subject: Reply with quote

Centurion

Joined: 09 Dec 2005
Posts: 141
Location: Lima, Peru

WMBDEV1 wrote:
1) merge the flows

Is solutions?....i think is last alternative.
_________________
Oscar Vásquez Flores
Back to top
View user's profile Send private message Send e-mail
mqxplorer
PostPosted: Sat Aug 29, 2009 10:51 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

"Pass the Soap envelope in the message to the second flow.
"

I am bit confused with this statement.

Actually, this is the sample flow I am trying. In real time, we have a project where we have three message flows.

First flow:

The request message comes onto the HTTPInput node in the first flow. Now we are taking off the soap enve;ope in one compute node and putting it in a queue in MQOutput node. In another compute node we are taking the envelope off and passing the message without soap envelope to the second flow.

Second flow:

The second flow converts the mesage from XML to COBOL and send s it to mainframe. The reply from mainframe comes and lands in a queue configured on the MQInput node of the third flow.

Third flow:
The third flow converts the message back to XML and adds the SOAP envelope to the message by getting it from the first flow hold queue(where we stored the soap envelope and http reply identifier) using MQGet node.

With this scenario we are facing problems with namespace while migrating from V5 to V6.1 So we are just trying to make use of SOAP Extract and SOAP Envelope nodes to extract the SOAP envelope in the first flow and use it to add in the Third flow using SOAP Envelope node, however, as the extracted envelope in the fisrt flow is coming into the path Environmenet/SOAP/Envelope we cannot use it in the thrid flow.

Passing the SOAP envelope in the message to the second flow (in our case it would be third flow)....How can we do this? Could you explain me little bit more...?


Thanks
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Sat Aug 29, 2009 1:03 pm    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

The multiple flow approach seems to be making the problem more difficult than it needs to be.

Accept the HTTP request ---- Use a SOAP Extract --- Convert the message payload to COBOL --- send the COBOL request to the mainframe -- save the MSGID (after the MQOutput) --- Use an MQGet with wait & CorrelId (= the saved msgId) - transform the response back to XMLNSC - -- re-add the Envelope information with the SOAP Envelope node --- send a HTTP Reply back.

Error handling and other details left to the programmer. You may also want to remove any RFH2 headers before sending to the mainframe.

Since its one flow, the request ID for the HTTP (or SOAP) input can be saved in the Environment and then restored just before the reply.
_________________
Bill Matthews
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Sat Aug 29, 2009 9:04 pm    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi All,

In my sample test message flows, I have done as below:

First Flow:

MQInput --> SOAP Extract --> Floworder --> Here I have connected a compute node to the first terminal of Floworder node and I am writing the below code to save the soap envelope and keep it in a queue on the MQOutput node.

CALL CopyMessageHeaders();
SET OutputRoot.MQMD.CorrelId = InputRoot.MQMD.MsgId;
SET OutputRoot.XMLNS.Envelope = Environment.SOAP.Envelope;

Here "Environment.SOAP.Envelope" is the soap envelope destination path specified on SOAP Extract node.

I am connecting another compute node to the second terminal of the Floworedr node and I am just copying the message id into correll id and I am passing the message (without envelope) to the next flow as request message.

In the second flow, I am using a MQGet node after the MQInput node and getting the message from the hold queue in the first flow into Environment.MqGetInfo (which I have set on the "Outputdata Location" ). After that I am using a SOAP envelope node to add the soap envelope to the message which I have in the path Environment.MqGetInfo.XMLNS.Envelope for which I have set the "Existing Envelope location" as $Environment/MqGetInfo/XMLNS/Envelope on the SOAP Envelope node. I am not getting any exceptions in the flow, however, when I see the message in the output queue on the MQOutput node after SOAP Envelope node, I see the message with NS1:..

I am not able to understand where I am going wrong.

Here is the sample input message which I am getting onto my input queue configured on the MQInput node of the first flow.

-----------------------

<?xml version="1.0"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<tns:requestHeader>
<tns:assessorUrl>header1</tns:assessorUrl>
</tns:requestHeader>
</soapenv:Header>
<soapenv:Body>
<tns:requestAvailability>
<tns:carDetails>body1</tns:carDetails>
<tns:claimID>body2</tns:claimID>
<tns:location>body3</tns:location>
<tns:reqDate>body4</tns:reqDate>
</tns:requestAvailability>
</soapenv:Body>
</soapenv:Envelope>

------------------

and the final output message in my output queue configured on the MQOutput node of the second flow looks like this:

------------------------

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Header>
<NS2:requestHeader xmlns:NS2="http://ws3.st.mqsi.ibm.com/App/DocLiteral1">
<NS2:assessorUrl>header1</NS2:assessorUrl>
</NS2:requestHeader>
</NS1:Header>
<NS1:Body>
<NS1:requestAvailability xmlns:NS1="http://ws3.st.mqsi.ibm.com/App/DocLiteral1">
<NS1:carDetails>body1</NS1:carDetails>
<NS1:claimID>body2</NS1:claimID>
<NS1:location>body3</NS1:location>
<NS1:reqDate>body4</NS1:reqDate>
</NS1:requestAvailability>
</NS1:Body>
</NS1:Envelope>

------

Could someone explain me where this NS1 part is coming and why I am not getting the desired output message?

any suggestions would be appreciated.

Thanks in advance
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Mon Aug 31, 2009 8:15 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

ovasquez wrote:
WMBDEV1 wrote:
1) merge the flows

Is solutions?....i think is last alternative.


I disagree. At the time of writing we did not know enough about the OPs flows. This is a valid solution and would have kept things simple so it could be considered as a valid option.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 31, 2009 8:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If nothing else, it's probably better to get it working as one flow and then do the easier steps to break it apart.

This way you are only trying to solve one problem at a time, rather than two or three.
Back to top
View user's profile Send private message
Luke
PostPosted: Mon Aug 31, 2009 9:57 am    Post subject: Reply with quote

Centurion

Joined: 10 Nov 2008
Posts: 128
Location: UK

Hi,

When you copy your header to and from the Environment, are you creating the folder in the Environment using the DOMAIN clause? e.g.


Code:
CREATE LASTCHILD OF Environment.Variables DOMAIN 'XMLNS' NAME 'Envelope'


I've seen the NS1: prefix before, and this was the cause. You must specify a namespace aware domain in the Environment.
Back to top
View user's profile Send private message
Luke
PostPosted: Mon Aug 31, 2009 10:39 am    Post subject: Reply with quote

Centurion

Joined: 10 Nov 2008
Posts: 128
Location: UK

Just to clarify that, when I say this was the cause, I mean NOT using a statement like the one in my example was the cause ...
Back to top
View user's profile Send private message
mqxplorer
PostPosted: Mon Aug 31, 2009 11:54 am    Post subject: Reply with quote

Master

Joined: 22 Jun 2009
Posts: 206

Hi Luke,

Thanks for your reply.

Actually, I put a compute node after the MQInput node in my first flow and I wrote the below code there.

CALL CopyEntireMessage();

CREATE FIRSTCHILD OF Environment DOMAIN 'XMLNSC' TYPE XMLNSC.Folder NAME 'MyCachedData';


I have setup the SOAP Envelope destination as $Environment/MyCachedData on the SOAPExtract node. As I have already mentioned, I am passing the message coming out of the SOAP Extractnode to two compute nodes using a Filter node, in the first compute node, I am just copying the message headers and the envelope stotred in the 'Environment.MyCachedData' using the statement:

SET OutputRoot.XMLNSC.Envelope = Environment.MyCachedData;

After this I am placing the message in a hold queue which I am retrieving it in the second flow using MQGet Node. With all the procedure I followed , I could get rid of the NS1 part in my SOAP Envelope and I am able to get the whole Envelope without missing anything.

The another problem I am facing now is: when I am passing the message coming out of the SOAP extract node (withput envelope) to the second compute node, and in this compute node I am just passing the entire message along with copying the correlid into msgid. When I am putting the message in a queue on an MQOutput node, the message has NS1 qualifires again which is making my final output message being put in the queue with SOAP Envlope added in a proper way but the body has NS1 qualifiers (which is not desired).

The sample input message for the flow is:

<?xml version="1.0"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<tns:requestHeader>
<tns:assessorUrl>header1</tns:assessorUrl>
</tns:requestHeader>
</soapenv:Header>
<soapenv:Body>
<tns:requestAvailability>
<tns:carDetails>body1</tns:carDetails>
<tns:claimID>body2</tns:claimID>
<tns:location>body3</tns:location>
<tns:reqDate>body4</tns:reqDate>
</tns:requestAvailability>
</soapenv:Body>
</soapenv:Envelope>

and the message being put onto the hold queue (SOAP Envelope) is:

<Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://ws3.st.mqsi.ibm.com/App/DocLiteral1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<tns:requestHeader>
<tns:assessorUrl>header1</tns:assessorUrl>
</tns:requestHeader>
</soapenv:Header>
</soapenv:Envelope>
</Envelope>

This is fine (After placing the compute node before SOAPExtract node and wrote the code mentioned), however the message being put on the request queue (final queue of first flow) to the second flow is:

<?xml version="1.0"?>
<NS1:requestAvailability xmlns:NS1="http://ws3.st.mqsi.ibm.com/App/DocLiteral1">
<NS1:carDetails>body1</NS1:carDetails>
<NS1:claimID>body2</NS1:claimID>
<NS1:location>body3</NS1:location>
<NS1:reqDate>body4</NS1:reqDate>
</NS1:requestAvailability>

How can I get rid of this NS1 to the Body of the message? Could someone guide me? Any help would be appreciated.

Thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 31, 2009 12:00 pm    Post subject: Reply with quote

Grand High Poobah

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

mqxplorer wrote:
How can I get rid of this NS1 to the Body of the message? Could someone guide me? Any help would be appreciated.


NS1/2/3/4/5 etc is inserted by WMB when you don't explicitly give a prefix for the namespace that the element in question uses. First un-named namespace (if you see what I mean) is NS1, the next (if present, not present in your example) would be NS2 and so forth.

Explicitly define a namespace(s) for the body elements and WMB will use that instead of NS1.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 31, 2009 12:05 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
Explicitly define a namespace(s) PREFIX
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Using SOAP Extract and SOAP envelope nodes
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.