I have a B2B service running which has a front side as2 handler. The AS2 part works fine from parter to parter etc. Once the B2B service hands off to my MPGW I call an external URL via the open-url extension function from an XSL stylesheet. The response code of this call I wish to pass back to the AS2 handler on the return of the backend call. I have been playing around setting various variables regarding settings repsonse codes but im sure this code is not being set in the response back to the AS2 handler and the AS2 handler propagating it to the test tool i am using.
In essence the real world scenario is -
1. A partner sends in AS2 message(post a message to AS2 handler via http test tool).
2. AS2 handler handsoff to backend url.
3. Backend MPGW url receives XML message.
4. MPGW handsoff to a java webservice via open-url extension function via a transform action in a policy.
5. Java webservice returns and the asscociated response code returned is set in the stylesheet to <dp:set-response-header name="'x-dp-response-code'" value="$cache-response/url-open/responsecode"/>.
6. MPGW returns to AS2 handler...
7. AS2 handler returns to http testing tool.
Any help much appreciated...
Pinned topic Setting http resonse code in MPGW back to an AS2 handler.
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2010-03-10T01:21:58Z at 2010-03-10T01:21:58Z by LGD
swlinn 100000E7QE1348 Posts
Re: Setting http resonse code in MPGW back to an AS2 handler.2010-03-09T13:23:33ZThis is the accepted answer. This is the accepted answer.I posted this about setting the http response code, so perhaps this will work in your case.
SystemAdmin 110000D4XK6772 Posts
Re: Setting http resonse code in MPGW back to an AS2 handler.2010-03-09T15:27:02ZThis is the accepted answer. This is the accepted answer.Is your MPGW a loopback (i.e. var://service/mpgw/skip-backside variable set to 1)? Are you doing this, <dp:set-http-response-header name="'x-dp-response-code'" value="$cache-response/url-open/responsecode"/>, in a Request Rule instead of a Response Rule?
If your Java WebService is the actual Provider, I would recommend letting the MPGW make a "backside call" to the WebService by setting the backend URL rather than using the url-open to make a "side call", MPGW Response Type can be set to Pass-Thru.
Re: Setting http resonse code in MPGW back to an AS2 handler.2010-03-09T19:41:57ZThis is the accepted answer. This is the accepted answer.
I have added an error rule which now does collect the responses. If you do a probe you can see the service variables set with the return of that call for the extension function. Just seems to not get back to the caller...
Re: Setting http resonse code in MPGW back to an AS2 handler.2010-03-09T20:05:53ZThis is the accepted answer. This is the accepted answer.
var://service/error-code string 0x01130006
var://service/error-headers string 'HTTP/1.1 500 Error Content-Type: text/xml X-Backside-Transport: FAIL FAIL Connection: close '
var://service/error-ignore string '0'
var://service/error-message string 'Failed to establish a backside connection'
var://service/error-subcode string '0x00000000'
var://service/formatted-error-message string '<?xml version='1.0' ?> <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Body> <env:Fault> <faultcode>env:Client</faultcode> <faultstring>Internal Error</faultstring> </env:Fault> </env:Body> </env:Envelope> '
However this information seems to not get back to the original as2 caller.
Re: Setting http resonse code in MPGW back to an AS2 handler.2010-03-10T01:21:58ZThis is the accepted answer. This is the accepted answer.
Seems the test tool was receiving status back from the as2 handler on the partner side which of course was a successful http post all the time.
I had set up a partner local to the xb60 that had an http fsh which then created an as2 message and posted to "my" inbound b2b partner...
Cheers for your help guys.