Author |
Message
|
gauravd |
Posted: Fri Sep 09, 2011 1:56 pm Post subject: Asynchronous SOAP Webservices -WMB 7 as ESB - Problem |
|
|
Newbie
Joined: 09 Sep 2011 Posts: 4
|
Hi All,
I am trying to expose an existing asynchronous webservice via WMB 7.0 as an ESB.
I have made the following flows -
Flow 1
---------
SOAPInput --> Trace --> SOAP Asynchrnous Request ( to my async webservice)
Flow 2
---------
SOAPAsynchronous Response -- > Trace --> SoapReply
I have placed the flows in same execution group and corelated the flows via unique common ID. I believe the existing SOAP webservice should be ws-addressing enabled which has been done.
The webservice client now invokes the esb endpoint which triggers the flows. I can see the trace messages being generated at Flow 1 and my service is responding with the appropriate reply. The flow2 also gets triggered and i can see the trace containing the reply. However the response from Flow2 never comes back to my client - The SOAP reply node never sends back the response. There is an error at eventviewer which says -
"Message does not contain a valid SOAP Reply Identifier. A valid SOAP Reply Identifier is required for SOAP Reply processing to be successful. The needed information was not found in the incoming message, and no SOAP reply can be made
Provide the required SOAP Reply Identifier."
I have tried viewing existing forums in which it was mentioned to place WS-Addressing headers in local environment. I have implement this too but to no avail.
When i check the File trace for ReplyId - both the traces at flow 1 and 2 reveals the same id-
Request Trace
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
Response Trace
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
Can you please help me out with the problem ?
Thanks,
Gaurav |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 09, 2011 8:53 pm Post subject: Re: Asynchronous SOAP Webservices -WMB 7 as ESB - Problem |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gauravd wrote: |
I have tried viewing existing forums in which it was mentioned to place WS-Addressing headers in local environment. I have implement this too but to no avail.
When i check the File trace for ReplyId - both the traces at flow 1 and 2 reveals the same id-
Request Trace
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
Response Trace
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
Can you please help me out with the problem ?
Thanks,
Gaurav |
Did you also change the properties of the node where you set the environment to say Message+Environment and did you use OutputLocalEnvironment?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 12, 2011 4:29 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Also, both the sender flow and the receiver flow need to be in the same execution group.
As you know, a ReplyIdentifier in the LocalEnvironment tree is used to correlate the inbound reply message when the AsyncRequest node sends the message.
You need to forward the necessary correlation information to the reply flow yourself. Since LocalEnvironment is specific to one flow invocation, set the value some place accessible by both flows.
For example: a database or a Singleton. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Sep 12, 2011 5:11 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Your model seems to be very close to a normal Sync SOAP rather than an Async one.
Can't you use a Sync call and have additional instances? _________________ 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 |
|
 |
mgk |
Posted: Mon Sep 12, 2011 6:25 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
You need to forward the necessary correlation information to the reply flow yourself. Since LocalEnvironment is specific to one flow invocation, set the value some place accessible by both flows. |
Not in this case. The Async SOAP nodes are a special case - they automatically forward the ReplyIdentifier from the SOAP AsyncRequest flow to the SOAP AsyncResponse flow using the WSA headers to store the data. In the response flow the node places the ID into the correct place in the LE in the correct format. Therefore, if this is not working, it looks like the ID is not sent, possibly because the message the AsyncRequest node received at its IN terminal did not have the Reply info in the LocalEnvrionment. So, put a trace node that traces the LE immediately before the AsyncRequest node and look at the LE and see if there is the reply identifier there. If there is not, check the flow for compute nodes that do not copy the LE (and / or do not have the ComputeMode set to include the LE). If there is the ID information, place a trace node immediately after the AsyncResponse node to see if the ID was flowed correctly through the WSA enabled web server. If you still have problems, paste your trace node output here...
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 |
|
 |
gauravd |
Posted: Mon Sep 12, 2011 9:24 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2011 Posts: 4
|
Thanks everyone for the responses. It was very helpful.
@mgk - You are spot on with your analysis. I dont think the replyId is preserved between AsyncRequest and AsyncResponse flows.
Here are the trace output of LocalEnvironment--
Before the AsyncRequestNode - 1st Flow
Code: |
( ['MQROOT' : 0xb26020]
(0x01000000:Name):Destination = (
(0x01000000:Name):SOAP = (
(0x01000000:Name):Reply = (
[b] (0x03000000:NameValue):ReplyIdentifier = X'534f4150000000000000000000000000c00e000000000000' (BLOB)
)[/b] )
(0x01000000:Name):RouterList = (
(0x01000000:Name):DestinationData = (
(0x03000000:NameValue):labelName = 'squareNumber' (CHARACTER)
)
)
)
(0x01000000:Name):SOAP = (
(0x01000000:Name):Input = (
(0x01000000:Name):Transport = (
(0x01000000:Name):HTTP = (
(0x03000000:NameValue):MaxClientWaitTime = 180 (INTEGER)
)
)
) |
After the Async Respose Node - 2nd flow
Code: |
( ['MQROOT' : 0xb25bd0]
(0x01000000:Name):SOAP = (
(0x01000000:Name):Response = (
(0x01000000:Folder):WSA = ( ['xmlnsc' : 0xb259a8]
(0x03000000:PCDataField):To = 'http://10.24.81.42:7801/WMB/Async/Response/Node/Math_Async?context=534f4150000000000000000000000000c00e000000000000×tamp=4782' (CHARACTER)
(0x01000000:Folder ):ReplyTo = (
(0x03000000:PCDataField):Address = 'http://www.w3.org/2005/08/addressing/anonymous' (CHARACTER)
)
(0x03000000:PCDataField):Action = 'http://service.esb.tcs.com/Mathematics/squareNumberResponse' (CHARACTER)
(0x03000000:PCDataField):MessageID = 'urn:uuid:51ca6a06-2291-433e-a1c2-0d5c522db44e' (CHARACTER)
(0x03000000:PCDataField):RelatesTo = 'urn:uuid:4469BE87590E442FAD1315846730211' (CHARACTER)
(0x01000000:Folder ):ReferenceParameters = (
(0x03000000:PCDataField)http://www.ibm.com/wmb/2007/05/rp:context = 'squareNumber534f4150000000000000000000000000c00e0000000000004782' (CHARACTER)
(
(0x03000102:NamespaceDecl):xmlns = 'http://www.w3.org/2005/08/addressing' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:wsa = 'http://www.w3.org/2005/08/addressing' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:ns2 = 'http://www.ibm.com/wmb/2007/05/rp' (CHARACTER)
)
)
(0x03000000:PCDataField):Version = 'Final-2005/08' (CHARACTER)
)
)
)
) |
I think WMB is getting the response from the service but is not able to ascertain the correct replyId to send response to.
Can you please help me in solving this issue? FYI - I am not using any compute nodes in between in any flows.
[/b] |
|
Back to top |
|
 |
gauravd |
Posted: Mon Sep 12, 2011 9:31 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2011 Posts: 4
|
While investing on the replyId issue i noticed the "/addressing/anonymous" data at the asynchrnous response node-
I sniffed the payload at the service provide end - and I see two responses being sent by the webservice - One of the response contains anonymous response payload while the 2nd response contains the actual response of the service ( For simplicity sake this service just takes an intger and squares it - this squared response is present in 2nd response) -
Here are the response payload- I think the 1st response is not understood by WMB. Please advise..
Outbound Message 1---------------------------
Code: |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:92349ec2-a78e-4276-9659-c23bec9d293f
</MessageID>
<To xmlns="[b]http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous[/b]</To>
<ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>[b]http://www.w3.org/2005/08/addressing/none[/b]</Address>
</ReplyTo>
<RelatesTo [b]xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/unspecified[/b] </RelatesTo>
</soap:Header>
<soap:Body />
</soap:Envelope> |
--------------------------------------
Outbound Message 2---------------------------
Code: |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Action xmlns="http://www.w3.org/2005/08/addressing">http://service.esb.com/Mathematics/squareNumberResponse
</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:423f3493-27a1-46f2-a97b-88bc877610c9
</MessageID>
<To xmlns="http://www.w3.org/2005/08/addressing">http://10.24.81.42:7801/WMB/Async/Response/Node/Math_Async?context=534f4150000000000000000000000000980d000000000000&timestamp=3810
</To>
<RelatesTo xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:4469BE87590E442FAD1315845755210
</RelatesTo>
<ns2:context xmlns="http://www.w3.org/2005/08/addressing"
xmlns:ns2="http://www.ibm.com/wmb/2007/05/rp" xmlns:wsa="http://www.w3.org/2005/08/addressing"
wsa:IsReferenceParameter="1">squareNumber534f4150010000000300000000000000980d0000000000003810
</ns2:context>
</soap:Header>
<soap:Body>
<ns2:squareNumberResponse xmlns:ns2="http://service.esb.com/">
[b]<return>4</return>[/b] </ns2:squareNumberResponse>
</soap:Body>
</soap:Envelope> |
Please advise.............. |
|
Back to top |
|
 |
mgk |
Posted: Mon Sep 12, 2011 11:23 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
So, the second message looks much more like what I would expect to see on a response. However, even this is not completely correct, as the reference parameter looks wrong. What is the backend server here? I would check its WSA configuration as it does not look right and I would not expect to see two messages in response, rather I would excpect only one response...
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 |
|
 |
gauravd |
Posted: Mon Sep 12, 2011 11:48 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2011 Posts: 4
|
Thank you for the help.
Iam using Tomcat 6.0 for testing.. we intend to move to websphere 7 and we are using CXF 2.4 as the native webservice implementation.
However I noticed one additional thing - The first response sent by CXF has a HTTP Status code of 200 with a empty body. Ideally it should be a HTTP 202 so the client invoking the service does not treat it a complete response.
I guess this might the problem here- as WMB treats this as a actual response instead of treating 2nd response as the actual response. I looked at the CXF bugs JIRA and they have acknowledged that this is a bug (CXF-3768).
I would love to hear you thoughts on this. Also you mentioned that reference parameter looks wrong - Iam curious to know what the correct reference parameter should be passed by service? |
|
Back to top |
|
 |
mgk |
Posted: Mon Sep 12, 2011 12:14 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I guess this might the problem here- as WMB treats this as a actual response instead of treating 2nd response as the actual response. I looked at the CXF bugs JIRA and they have acknowledged that this is a bug (CXF-3768). |
So this looks like the cause of the problem. The 202 response should be sent back to the Originating client (the AsyncRequest node in this case) and not the final destination (the AsyncResponseNode) as that should only expect to see the actual response, whereas the requeser will be expecting the 202 ack. Also, the 202 Ack would not normally have a body!
As for the reference parameter, the server has seemed to have concatenated the ReplyId with the operation name which seems odd. If you run this flow "back to back" with Broker, which is as setup like this:
Flow1: IN ... [rest of flow] ... -> SOAPAsyncRequest
Flow2: SOAPInput (WSA ON) -> Compute -> SOAPReply
Flow3: SOAPAsyncResponse -> [rest of flow]
And look at the HTTP traffic between Flow1 and Flow2 and between Flow2 and Flow3 then you will see what the expected message should be....
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 |
|
 |
|