[#ESBJAVA-2630] Content-Type: application/octet-stream

advertisement
[ESBJAVA-2630] Content-Type: application/octet-stream eventhough the
response comes as application/xml in PT Created: 06/Nov/13 Updated: 11/Nov/13 Resolved: 11/Nov/13
Status:
Project:
Component/s:
Affects
Version/s:
Fix Version/s:
Closed
WSO2 ESB
Core Engine
4.8.0
Type:
Reporter:
Resolution:
Labels:
Remaining
Estimate:
Time Spent:
Original
Estimate:
Bug
Ushani Balasooriya
Not a bug
None
Not Specified
Severity:
Estimated
Complexity:
Attachment
License:
Major
Moderate
4.8.0
Priority:
Assignee:
Votes:
High
dushan abeyruwan
0
Not Specified
Not Specified
I agree to grant a license to WSO2 for this work for inclusion in WSO2
works as per the WSO2 Contributor License Agreement and the Apache
License 2.0
Test cases added: Yes
Description
Content-Type: application/octet-stream even-though the response comes as application/xml in
PT.
Was executing the REST Client and REST Service sample in
http://docs.wso2.org/display/ESB480/Using+REST+with+a+Proxy+Service
Following synapse has been used.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="CustomerServiceProxy"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<switch source="$axis2:HTTP_METHOD">
<case regex="GET">
<property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
</case>
<case regex="POST">
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
</case>
<default/>
</switch>
<send>
<endpoint>
<address uri="http://localhost:9774/jaxrs_basic/services/customers/customerservice"
format="pox"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
<sequence name="fault">
<log level="full">
<property name="MESSAGE" value="Executing default "fault" sequence"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</log>
<drop/>
</sequence>
<sequence name="main">
<log/>
<drop/>
</sequence>
</definitions>
Invoked via the following curl command,
curl -v -i http://localhost:8280/services/CustomerServiceProxy/customers/123
Response came as following :
> GET /services/CustomerServiceProxy/customers/123 HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4
libidn/1.23 librtmp/2.3
> Host: localhost:8280
> Accept: /
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: application/octet-stream
Content-Type: application/octet-stream
< Date: Wed, 06 Nov 2013 10:02:31 GMT
Date: Wed, 06 Nov 2013 10:02:31 GMT
< Server: WSO2-PassThrough-HTTP
Server: WSO2-PassThrough-HTTP
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
<


Connection #0 to host localhost left intact
Closing connection #0
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?><Customer><id>123</id><name>John</name></Customer>
Comments
Comment by dushan abeyruwan [ 11/Nov/13 ]
This is not a bug since BE returns the application/octet-stream, if customer specifically defines
Accept in incoming headers then obviously the ESB sends back the Content-Type define under
Accept heders
Generated at Tue Feb 09 20:35:16 IST 2016 using JIRA 6.0.1#6096sha1:e4a48bd73c6b8a4d99c824976ce5808b4c85857d.
Download