There are
two types of web services. SOAP and REST web services. We usually deal with
SOAP web services in Oracle SOA but we can also create RESTful web services in
SOA.
RESTful web services are built to work best on the Web. Representational State Transfer (REST) is an architectural style. In REST data can be transmitted over a standardized interface (such as HTTP).
First create
one SOA project. In composite.xml file drag “HTTP Binding” adapter and start
configure it.
Choose “service” from type drop-down list.
Choose request and response element from your schema.
Once you create HTTP binding adapter, drag a BPEL process to composite.xml file.
Wire your
BPEL process with HTTP adapter.
http://localhost:8001/soa-infra/services/default/RESTfulService/http_Client?input=test&operationName=Request-Response
RESTful web services are built to work best on the Web. Representational State Transfer (REST) is an architectural style. In REST data can be transmitted over a standardized interface (such as HTTP).
This post
shows how we can create RESTful web service in Oracle SOA. Follow below steps
to create it.
We will use
below schema for this post.Choose “service” from type drop-down list.
Choose request and response element from your schema.
Once you create HTTP binding adapter, drag a BPEL process to composite.xml file.
Inside BPEL
process, add receive activity and link it to HTTP adapter to receive the
request.
Add reply
activity and link it to HTTP adapter to send the response back.
Deploy your
composite.
You can test
your composite using below URL.
http://localhost:8001/soa-infra/services/default/RESTfulService/http_Client?input=test&operationName=Request-Response
Testing Results
Sample Code for this Post
you missed step for add assign activity in bpel for wire input ( request ) and output ( response )
ReplyDeletewithout it reply will be empty
alex
Alex,
DeleteThis post is just to show how to create Restful service and you can add whatever logic you need inside BPEL.
Vivek
hi vivek..
ReplyDeletethanks for ur post and i have a question..when i want to invoke my Asynchronous BPEL service as a Restful service, i am making it through HTTP binding adapter and it makes me confuse as how HTTP binds to the Asynchronous BPEL as if we select the Request-Response operation in HTTP,,,
thanks in advance..
Hi Vivek,
ReplyDeleteHow to test a Rest Service using SOAPUI tool.
Thanks in advance.
can we return json using ACCEPT:application/json http request header... any suggestions?
ReplyDeleteHi, i want to setup the request as mentioned like below sample. Here i want to setup Doctype & schemalocation. How i can add it on top of the root element.
ReplyDelete4efeb43b-3d4e-46e0-907a-015b62e31959
2017-04-12T11:58:22.112-04:00
....
..
...
....
I want to add the doctype & schemalocation on top of the root element. i have given sample in below.
ReplyDelete4efeb43b-3d4e-46e0-907a-015b62e31959
2017-04-12T11:58:22.112-04:00
....
..
...
....