Exposing the BPEL process as a Http Service using HTTP Binding Adapter – Oracle SOA Suite:
By default the BPEL processes can be invoked via SOAP service, sometimes we may need to invoke the service from the HTTP client by using the HTTP methods – GET/POST
The HTTP Binding Adapter will help us
to expose the BPEL process as an HTTP Service.
If we are exposing the service as a
HTTP service, the marshaling/unmarshaling overhead related to soap can be
avoided when the client invoke the service.
Steps to Expose the BPEL process as a
HTTP Service:
- Create a new SOA project with the Composite Template as Empty
- Open the Composite.xml and Insert HTTP Binding Adapter to Exposed Services section.
- Configure the Adapter
1.
Select the Interface
Option as “Define from operation and schema specified later”
2.
Select the operation type,
verb(HTTP Method) and payload type accordingly
3.
Provide the
Request/Response Message Schema
- Insert a BPEL Component in the Components section and use the Define Service Later template.
- Make a wire between the Service and the BPEL component.
- Open the BPEL component and add a Receive, Reply Activity and the required activities (create input/output variables before starting mappings) to finish the flow- Make sure the Create Instance Check box is selected in the Receive activity.
- Connect the Receive/Reply activities to the client partner link.
- To expose the service with both GET/POST http methods, remove the http.verb and http.payload properties configured in the Composite.xml
- Deploy the composite to the server and open the end point URL in browser to test the service. http://localhost:8000/soa-infra/services/default/HttpService/HttpBinding
Albin,
ReplyDeletePlease let me know how to invoke a RESTful service using HTTP Post.
Hi Albin,
ReplyDeleteI Tried to follow the same Approch for one of My Requirement but this Does not work in case of POST.I have Created a sample HTML Page which invoke this service with POST but not working. Can you pls. help how to acheive POST in HTTP adapter.
I have a requirement where i need to take an Image as Service Input in a Rest Service & Send that Image as Email Attachment.
To achieve this I used a HTTP Adapter with Type- Service , Operation- Request-Response & Verb- GET and payload type - url encoded and recieving the image as
an input in base64Binary element and sending that as attachment. Can test in browser by using the URL.
*GET*
url-encoded
This works fine if Image is small , but if Image is large GET does not work due to size limitation of GET , to avoid this in the HTTP Adapter i used Verb- POST
*POST*
url-encoded
But this does not work as the Service is not getting Invoked . Created a sample HTML Page which invoke this service with POST but not working . GET works perfectly fine but Issue with POST.
Please help in identifying the Issue with POST , do i need to do anythng additional in my SOA Service to support HTTP POST.