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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Calling REST Service from OSB.

Siddhardha MJul 11 2012 — edited Jul 12 2012
Hi All,

I am calling a rest service from OSB BusinessService and tested it using Test Console.It worked fine.
When i am calling the BusinessService from ProxyService ,The invocation is failing in BusinessService with following error.

BEA-380000: General runtime error: charsetName

Details of the Service:
=============

URL : http://api.geonames.org/postalCodeSearch?postalcode=90110&username=siddhardha

It has 2 parameters ..postalcode & username.

Populated below to outbound variable as part of callout.

1# <http:http-method>GET</http:http-method>

2# <http:query-parameters>
<http:parameter name="postalcode" value="{$v}"/>
<http:parameter name="username" value="{$q}"/>
</http:query-parameters>


Can someone point me to any code sample for this.Where i am doing wrong.

NOTE : The main question is how to send the query parameters to BusinessService from Proxy Service.
I am getting these values from the user as part of XML input.

Thanks,
Sid.

Comments

Siddhardha M
At high level the trace looks like this...
I am not sure where it failed,Whether invocation of BizService failed or Invocation of REST from Biz failed.?

Route to: "MyLifeProtalBizService"
$outbound:
$body (request):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
$header (request):
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
$attachments (request):

$outbound
=======

<con:endpoint name="BusinessService$MyLifeOSBProject$MyLifeProtalBizService" xmlns:con="http://www.bea.com/wli/sb/context">
<con:service/>
<con:transport>
<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>text/xml</http:Content-Type>
</tran:headers>
<http:query-parameters>
<http:parameter name="username" value="siddhardha"/>
<http:parameter name="postalcode" value="90110"/>
</http:query-parameters>
</con:request>
</con:transport>
<con:security>
<con:doOutboundWss>false</con:doOutboundWss>
</con:security>
</con:endpoint>

$body (request):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>

$header (request):
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
Siddhardha M
Error:
====

System Error Handler

$fault:
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>General runtime error: charsetName</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>
Eric Elzinga
see this example :
https://blogs.oracle.com/jeffdavies/entry/enhanced_rest_support_in_oracl

you just need to change the transport var with your parameters
Siddhardha M
I tried this sample using the same link.
I will read this again and see if i missed anything...

Thanks for the reply.I will update the post with my observations..
I might need your help to complete this sample , if it doesn't work today.

Thanks in advance,
Sid.
Siddhardha M
Eric,

In this sample they are not using BusinessService to call REST.
Looks like i messed up the bizService configuration.

Configuration of BizService:
================
ServiceType : MessageService
RequestMessageType : None
ResponseMessageType :Text
Endpoint URI : http://api.geonames.org/postalCodeSearch
HttpRequestMethod : GET


See if i am missing anything..
I created my proxy same as what is mentioned in the https://blogs.oracle.com/jeffdavies/entry/enhanced_rest_support_in_oracl

Thanks,
Sid.
Siddhardha M
Thank God..I found the issue..

I added the following into the outbound variable as a child to "./ctx:transport/ctx:request".

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

It solved the problem..

Thanks,
Sid.
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 9 2012
Added on Jul 11 2012
6 comments
1,889 views