Bug 845165 - Http Provider returns 200 http response code for Soap Fault
Summary: Http Provider returns 200 http response code for Soap Fault
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBossESB
Version: 5.3.0 GA
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: 5.3.1
Assignee: kconner
QA Contact: Lucie Fabrikova
URL:
Whiteboard:
Depends On:
Blocks: 852814 881861 848807
TreeView+ depends on / blocked
 
Reported: 2012-08-02 04:35 UTC by Jason Shepherd
Modified: 2018-11-29 20:42 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 852814 881861 (view as bug list)
Environment:
Last Closed: 2012-11-29 17:25:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer app (16.57 KB, application/zip)
2012-08-02 04:35 UTC, Jason Shepherd
no flags Details
untested patch built against JBESB_4_11_CP (rev.38169) (1.90 MB, application/octet-stream)
2012-09-05 08:06 UTC, Tadayoshi Sato
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBESB-3838 0 Major Closed Http Provider returns 200 http response code for Soap Fault 2014-03-03 09:57:11 UTC

Description Jason Shepherd 2012-08-02 04:35:19 UTC
Created attachment 601863 [details]
reproducer app

Description of problem:

When a pipeline includes a SOAPProcessor action which calls a Web Service, if the wrapped web service returns a soap fault, and HTTP response code 500, the HTTP Provider Gateway returns a response code 200 to an ESB Client, instead of the expected 500 response.

This seems contrary to the WS-I 1.0 Basic Profile specification, and breaks some Spring WS Clients.

This issue does not happen with a JBR-Provider using the HTTP protocol. The expected 500 response code is returned by it.

Version-Release number of selected component (if applicable):

ESB 4.11

How reproducible:

You can use the attached project to reproduce the issue.

Steps to Reproduce:

1. Replace the 'webservice_producer' quickstart in SOA-P 5.2 samples/quickstart directory with the one attached.

2. Run 'ant clean deploy' to deploy it to a running instance

3. Run 'ant runtest' to send a WS Request to the HTTP Provider gateway.

  
Actual results:

runtest:
[echo] Http Client
[java] Request payload:
[java] <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">
[java] <soapenv:Header/>
[java] <soapenv:Body>
[java] <good:sayGoodbye>
[java] <message>goodbye</message>
[java] </good:sayGoodbye>
[java] </soapenv:Body>
[java] </soapenv:Envelope>
[java] --------------------------
[java]
[java] 16:30:38,927 DEBUG [main][header] >> "POST /Quickstart_webservice_producer/http/test/x HTTP/1.1[\r][\n]"
[java] 16:30:38,970 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "Host: localhost:8080[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "Content-Length: 292[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "[\r][\n]"
[java] 16:30:38,973 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <soapenv:Header/>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <soapenv:Body>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <good:sayGoodbye>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <message>goodbye</message>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> " </good:sayGoodbye>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> " </soapenv:Body>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> "</soapenv:Envelope>"
[java] 16:30:39,265 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
[java] 16:30:39,266 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "asyncServiceInvoke: false[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "Content-Length: 298[\r][\n]"
[java] 16:30:39,268 DEBUG [main][header] << "Date: Mon, 30 Jul 2012 06:30:39 GMT[\r][\n]"
[java] 16:30:39,268 DEBUG [main][header] << "[\r][\n]"
[java] 16:30:39,273 DEBUG [main][content] << "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>app exception!</faultstring><detail><ns1:AppException xmlns:ns1="http://webservice_producer/goodbyeworld" /></detail"
[java] 16:30:39,273 DEBUG [main][content] << "></soap:Fault></soap:Body></soap:Envelope>"
[java]
[java] Response Status Code: 200
[java] Response payload:
[java] <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>app exception!</faultstring><detail><ns1:AppException xmlns:ns1="http://webservice_producer/goodbyeworld" /></detail></soap:Fault></soap:Body></soap:Envelope>
[java] --------------------------
[java]


Expected results:

runtest:
[echo] Http Client
[java] Request payload:
[java] <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">
[java] <soapenv:Header/>
[java] <soapenv:Body>
[java] <good:sayGoodbye>
[java] <message>goodbye</message>
[java] </good:sayGoodbye>
[java] </soapenv:Body>
[java] </soapenv:Envelope>
[java] --------------------------
[java]
[java] 16:30:38,927 DEBUG [main][header] >> "POST /Quickstart_webservice_producer/http/test/x HTTP/1.1[\r][\n]"
[java] 16:30:38,970 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "Host: localhost:8080[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "Content-Length: 292[\r][\n]"
[java] 16:30:38,973 DEBUG [main][header] >> "[\r][\n]"
[java] 16:30:38,973 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <soapenv:Header/>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <soapenv:Body>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <good:sayGoodbye>[\n]"
[java] 16:30:38,973 DEBUG [main][content] >> " <message>goodbye</message>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> " </good:sayGoodbye>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> " </soapenv:Body>[\n]"
[java] 16:30:38,974 DEBUG [main][content] >> "</soapenv:Envelope>"
[java] 16:30:39,265 DEBUG [main][header] << "HTTP/1.1 500 Error[\r][\n]"
[java] 16:30:39,266 DEBUG [main][header] << "HTTP/1.1 500 Error[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "asyncServiceInvoke: false[\r][\n]"
[java] 16:30:39,267 DEBUG [main][header] << "Content-Length: 298[\r][\n]"
[java] 16:30:39,268 DEBUG [main][header] << "Date: Mon, 30 Jul 2012 06:30:39 GMT[\r][\n]"
[java] 16:30:39,268 DEBUG [main][header] << "[\r][\n]"
[java] 16:30:39,273 DEBUG [main][content] << "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>app exception!</faultstring><detail><ns1:AppException xmlns:ns1="http://webservice_producer/goodbyeworld" /></detail"
[java] 16:30:39,273 DEBUG [main][content] << "></soap:Fault></soap:Body></soap:Envelope>"
[java]
[java] Response Status Code: 500
[java] Response payload:
[java] <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>app exception!</faultstring><detail><ns1:AppException xmlns:ns1="http://webservice_producer/goodbyeworld" /></detail></soap:Fault></soap:Body></soap:Envelope>
[java] --------------------------
[java]

Additional info:

Comment 1 JBoss JIRA Server 2012-08-28 05:39:14 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

This issue should have been addressed as part of JBESB-2511.

Comment 2 JBoss JIRA Server 2012-08-28 07:18:17 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

Attached a patch for this issue. I've verified it by running the existing unit and integration tests. We need a QA test to verify this fix itself.

Comment 3 JBoss JIRA Server 2012-08-28 07:18:57 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

Attached a patch (JBESB-3838.patch) for this issue. I've verified it by running the existing unit and integration tests. We need a QA test to verify this fix itself.

Comment 4 JBoss JIRA Server 2012-08-28 07:19:26 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

Attached a patch (JBESB-3838.patch) for this issue. I've verified it by running all the existing unit and integration tests. We need a QA test to verify this fix itself.

Comment 5 JBoss JIRA Server 2012-08-28 08:45:12 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

Attached a recompiled jar (jbossesb-soap.jar) with the patch against the latest JBESB_4_11_CP branch (rev. 38166).
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/branches/JBESB_4_11_CP/product/

Comment 6 JBoss JIRA Server 2012-08-28 09:41:26 UTC
Lucie Fabrikova <lfabriko> made a comment on jira JBESB-3838

I verified the problem on version SOA-P 5.3.0 GA, the patched version with reproducer generated status code 500.
Now we modify our test to reproduce the problem (add HTTP Provider).

Comment 7 JBoss JIRA Server 2012-08-29 14:05:08 UTC
Lucie Fabrikova <lfabriko> made a comment on jira JBESB-3838

If the webservice works properly and returns correct result and there is no need to return fault code (500), the patch is not working, it returns response code 0. It should return 200.

Comment 8 JBoss JIRA Server 2012-08-30 08:13:24 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3838

Thanks Lucie for your feedback! While a quick fix to my patch is easy, I am wondering if I should rather fix Http Gateway (HttpMessageComposer) instead of SOAPProcessor, because  SOAPProcessor + JBR Gateway doesn't observe this issue. My previous patch was for SOAPProcessor.

Comment 9 JBoss JIRA Server 2012-08-30 12:16:56 UTC
Jiri Sedlacek <jsedlace> made a comment on jira JBESB-3838

Hi Sato, 

we have new information for you. We tested with JBoss WS Native stack by mistake and that's the reason why we found the problem mentioned by Lucie. 

If JBoss WS CXF Stack is used, your patch returns proper codes both for OK(200) and server error(500), we will have to cover other possible response codes in our tests too. 

If JBoss WS Native Stack is used, the method call at line 212 cause the problem:

requestHandler.handleHttpRequest(endpoint, servletRequest, servletResponse, servletContext) ;

JBossWS Native implementation of this sets servlet response code in servletReponse object to 0 when call of WS was successful. Without your patch, in org.jboss.soa.esb.listeners.gateway.http.HttpMessageComposer.decompose(...) method, there is always used status 200 OK, response is not attached to message. With your patch, there is properly propagated reponseStatus into message, if there is fault in WS, status is 500 (which is desirable), but if WS is called without fault, status code is 0. 

My conclusion - the patch can be used as is now if JBossWS native stack problem will be fixed or a condition to check the status code when JBossWS native is used can be placed somewhere (into SOAPProcessor or HTTPMessageComposer?)  and fix it.

Comment 10 JBoss JIRA Server 2012-09-04 06:08:35 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3838

Done At revision: 38168

Sato, I completely took a different approach for setting the status. Please have a look at the commit and let me know.

Comment 11 JBoss JIRA Server 2012-09-04 06:42:50 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3838

At revision: 38169 for the JBossWS Native fix.

Comment 12 Tadayoshi Sato 2012-09-05 08:06:11 UTC
Created attachment 609887 [details]
untested patch built against JBESB_4_11_CP (rev.38169)

Hi Jiri and Lucie,

this (jbossesb-rosetta.jar) is the revised patch. Could you please test it again? We took a different approach from the previous one, so before applying it you have to rollback the previous one (jbossesb-soap.jar).

To apply this patch, replace the following jar with this patch:
$JBOSS_AS/server/$CONFIG/deployers/esb.deployer/lib/jbossesb-rosetta.jar

Thanks.

Comment 13 Jiri Sedlacek 2012-09-11 07:00:29 UTC
Hi Tadayoshi, 

Lucie tested provided patched jboss-rosetta.jar and our tests passed, I checked diffs of fixes and it looks ok so We agree with the patch.

Comment 14 JBoss JIRA Server 2012-09-13 12:06:01 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3838 to Closed

Comment 15 Lucie Fabrikova 2012-11-21 09:07:26 UTC
Verified in SOA-P 5.3.1 ER1.


Note You need to log in before you can comment on or make changes to this bug.