Author |
Message
|
wmqstankela |
Posted: Wed Nov 16, 2016 1:20 pm Post subject: HTTP Error Status Code 500, but SOAP Fault missing |
|
|
Voyager
Joined: 29 Feb 2016 Posts: 94
|
Hi all,
I'm trying to invoke web service using soap request node. When there is successful response with code 200 everything is work fine, but when I received HTTP error code 500 soap request node throws exception - A SOAP Request node received an HTTP Error Status Code 500, but the response message body was not a SOAP Fault. I understand that problem is in missing soap fault element with HTTP code 500, but still how can I use received message?
How to convert from ExceptionList hex value and how to know which value is soapenvelope message is?
Is there another way to catch received soapenvelope message?
Is soap request node automatically propagate message to failure terminal when receive HTTP status 500?
Help please |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 16, 2016 1:27 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
An HTTP RC 500 means that the server returned nothing other than an HTTP 500.
No data at all.
Not a SOAP Envelope, nothing.
Maybe some regular HTTP headers. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 16, 2016 1:31 pm Post subject: Re: HTTP Error Status Code 500, but SOAP Fault missing |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wmqstankela wrote: |
I understand that problem is in missing soap fault element with HTTP code 500, but still how can I use received message? |
Tell whoever's providing the web service that the W3C standard requires a Soap Fault element with a 500 return code and get them to fix their service.
wmqstankela wrote: |
How to convert from ExceptionList hex value and how to know which value is soapenvelope message is? |
The Exception List holds the error not the returned payload.
wmqstankela wrote: |
Is there another way to catch received soapenvelope message? |
No.
wmqstankela wrote: |
Is soap request node automatically propagate message to failure terminal when receive HTTP status 500? |
Yes - a 500 status is a failure. So the node treats it as a failure.
wmqstankela wrote: |
Help please |
See above.
If the provider can't or won't fix their web service, use an HTTPRequest node and build the request (including the SOAP envelope and other artifacts) by hand in code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 16, 2016 1:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
An HTTP RC 500 means that the server returned nothing other than an HTTP 500.
No data at all.
Not a SOAP Envelope, nothing.
Maybe some regular HTTP headers. |
Not true in every case. We have at least one provider who provides the "fault" in the form of a response element (rather than a fault element) with a 500 status.
You can make no comment about the validity of this that I have not already made.
The same provider sends a fault (in the form of a response) with a 200 status. Their rationale (or if you prefer, excuse) is that they've successfully handled the error by sending us a fault message and the 200 reflects their successful error handling.
We switch to a new provider Q2 2017.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mgk |
Posted: Thu Nov 17, 2016 1:18 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
Not true in every case |
Actually not true in any case
From RFC 2616 (http spec):
"10.5 Server Error 5xx
Response status codes beginning with the digit "5" indicate cases in
which the server is aware that it has erred or is incapable of
performing the request. Except when responding to a HEAD request, the
server SHOULD include an entity containing an explanation of the
error situation, and whether it is a temporary or permanent
condition. User agents SHOULD display any included entity to the user. These response codes are applicable to any request method. "
Also this is certainly not correct for SOAP - the WSI say that SOAP Faults should be returned with a 500 code, hence the error from IIB.
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 Thu Nov 17, 2016 3:14 am; edited 1 time in total |
|
Back to top |
|
 |
wmqstankela |
Posted: Thu Nov 17, 2016 2:36 am Post subject: |
|
|
Voyager
Joined: 29 Feb 2016 Posts: 94
|
Thanks for response!
I can't force backend web service to make change and to send HTTP 200 code. I need to catch that response and to use data from response.
When I use http request node, it propagate to error terminal and response is BLOB. How to convert BLOB to xml tree? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 17, 2016 4:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mgk wrote: |
Quote: |
Not true in every case |
Actually not true in any case
From RFC 2616 (http spec):
"10.5 Server Error 5xx
Response status codes beginning with the digit "5" indicate cases in
which the server is aware that it has erred or is incapable of
performing the request. Except when responding to a HEAD request, the
server SHOULD include an entity containing an explanation of the
error situation, and whether it is a temporary or permanent
condition. User agents SHOULD display any included entity to the user. These response codes are applicable to any request method. "
Also this is certainly not correct for SOAP - the WSI say that SOAP Faults should be returned with a 500 code, hence the error from IIB. |
As you well know, "SHOULD" is not the same as "MUST"....
And there's never a guarantee that the other side is actually returning a proper SOAP message. For example, the 500 could be coming from a router or webserver front end or or or...
If any data is returned, then a trace node or a user trace will show it. As Vitor says, get the service provider to fix their service - particularly if no data is returned.
Vitor also says check exception list instead of looking for a SOAP Fault message.
Clearly it's been too long since I've done this stuff in anger. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
wmqstankela |
Posted: Thu Nov 17, 2016 5:05 am Post subject: |
|
|
Voyager
Joined: 29 Feb 2016 Posts: 94
|
Thanks mqjeff for reply.
I've got soap responce:
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:xsd="http://www.services/xsd"/>
<soapenv:Body xmlns:xsd="http://www.services/xsd">
<xsd:Response>
<xsd:CommonResponse>
<xsd:error>
<xsd:errorCode>Error-E001</xsd:errorCode>
</xsd:error>
</xsd:CommonResponse>
</xsd:Response>
</soapenv:Body>
</soapenv:Envelope>
|
But http status code is 500, and message was propagate to error terminal(using http request) or failure terminal(using soap request).
In first case message is BLOB. Can you help me how to cast this BLOB message to XML tree? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 17, 2016 5:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You would use Create ... Parse to turn a blob into a logical message tree.
But you need to ask the service provider what "<xsd:errorCode>Error-E001</xsd:errorCode> " means, as that's a service specific error message.
And it's returned in an Soap Response, instead of a SOAP Fault. Which it should maybe be.
But again, that's all a question for the service provider, not anyone here.
By "service provider" we mean "the people who wrote the SOAP service you are calling". _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
wmqstankela |
Posted: Thu Nov 17, 2016 5:10 am Post subject: |
|
|
Voyager
Joined: 29 Feb 2016 Posts: 94
|
This response I've got when call web service using soapui and same message I've got from http request node but in blob type. |
|
Back to top |
|
 |
wmqstankela |
Posted: Thu Nov 17, 2016 5:20 am Post subject: |
|
|
Voyager
Joined: 29 Feb 2016 Posts: 94
|
It goes like this: I've expose web service that are calling another web service. I know what that E001 error means, but i need to propagate to my client same message as I've got from invoked web service.
Because of that I need to cast that BLOB response to xml tree so then I can return it to my client.
I try this:
Code: |
DECLARE inCCSID INT InputProperties.CodedCharSetId;
DECLARE inEncoding INT InputProperties.Encoding;
DECLARE inBitStream BLOB ASBITSTREAM(InputRoot.XMLNS.error.BLOB, inEncoding, inCCSID);
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(inBitStream, inEncoding, inCCSID,'BLOB', 'XMLNSC'); |
but i've got error:
The data type 'NULL' is not a valid data type for parameter 'BITSTREAM' of the 'CREATE' statement. This parameter should be of data type 'CHARACTER, BIT, BLOB'. The value passed was 'NULL'.
Is there another way to convert blob to xml tree? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 17, 2016 5:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wmqstankela wrote: |
But http status code is 500, and message was propagate to error terminal(using http request) or failure terminal(using soap request). |
Same situation as the one I describe - error message being sent as a response.
wmqstankela wrote: |
In first case message is BLOB. Can you help me how to cast this BLOB message to XML tree? |
Using the method described by my most worthy associate. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 17, 2016 5:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
wmqstankela wrote: |
I try this:
Code: |
DECLARE inCCSID INT InputProperties.CodedCharSetId;
DECLARE inEncoding INT InputProperties.Encoding;
DECLARE inBitStream BLOB ASBITSTREAM(InputRoot.XMLNS.error.BLOB, inEncoding, inCCSID);
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(inBitStream, inEncoding, inCCSID,'BLOB', 'XMLNSC'); |
but i've got error:
The data type 'NULL' is not a valid data type for parameter 'BITSTREAM' of the 'CREATE' statement. This parameter should be of data type 'CHARACTER, BIT, BLOB'. The value passed was 'NULL'.
Is there another way to convert blob to xml tree? |
The parse part of your command does not look right. Look it up int the infocenter. In particular I don't think the values 'BLOB' and 'XMLNSC' are right.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 17, 2016 5:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I don't understand why you are ASBITSTREAM to a BLOB and then PARSE the same BLOB...
If you want to switch from XMLNS to XMLNSC, just copy the logical message tree. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
joebuckeye |
Posted: Thu Nov 17, 2016 5:51 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
wmqstankela wrote: |
Is there another way to convert blob to xml tree? |
You could always use an RCD node attached to the Failure or Error terminals to make the response message XMLNSC.
Of course you could still have issues if the messages coming out of those terminals is not XML.
Years ago we had to redo our standard Datapower error rule to make sure SOAP Faults were being returned with an HTTP Status code of 500 so the broker SOAP node wouldn't fail on them.
We've also had our share of having to use the HTTP node instead of a SOAP node due to providers not following the W3C standards. When we point it out to them they don't really seem to care and say we are the first ones to complain about it. |
|
Back to top |
|
 |
|