Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RESTful business service with content-type application/json

859404May 30 2013 — edited May 30 2013
I'm making a proxy service (SOAP) in OSB, which invokes a RESTful business service that takes json input.
when i directly invok the business service through soap ui, it runs successfully. But when i pass the same through proxy service i receive following error: "Incorrect content-type header received. Should be 'application/json". find below the flow trace of the invokation through osb:
<con:transport>

<con:uri>

http://mysever.com:8090/tgs/token/activation


</con:uri>

<con:mode>request-response</con:mode>

<con:qualityOfService>best-effort</con:qualityOfService>

<con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


<tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">


<http:Content-Type>application/json; charset=utf-8</http:Content-Type>

<http:Host>mysever.com:8090</http:Host>

</tran:headers>

<tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>

<http:http-method>POST</http:http-method>

</con:request>

<con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


<tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">


<http:Server>Jetty(8.1.7.v20120910)</http:Server>

<http:Transfer-Encoding>chunked</http:Transfer-Encoding>

</tran:headers>

<tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>

<tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">Server Error</tran:response-message>

<tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>

<http:http-response-code>500</http:http-response-code>

</con:response>

</con:transport>

The only difference in SOAPUI request is that it sets <http:Content-Type>application/json</http:Content-Type>
i.e. without charset. I'm however not specifying charset utf--8 in my proxy flow, it is being done automatically when request reaches business service. I've put a log action in the end of request pipeline in proxy, and it shows <http:Content-Type>application/json</http:Content-Type>. So how can i deal with this charset which is being shown up in message execution trace?
If I try running the business service in soap ui with the <http:Content-Type>application/json; charset=utf-8</http:Content-Type> it gives the same error.
Please help

Edited by: 856401 on May 29, 2013 11:10 PM

Edited by: 856401 on May 30, 2013 12:17 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2013
Added on May 30 2013
0 comments
1,216 views