Tuesday 26 April 2016

How to expose and secure SOAP Webservices from Oracle B2B

There are many ways to integrate with you Oracle B2B through the use of SOAP WS and B2B supports both inbound and outbound message exchange.

This post provides an insight on how to expose securely SOAP web services to your trading partners.

As any channel to be consumed by your partners, you have to set it as a B2B Listening Channel. For that, B2B offers two flavors:

  1. Generic SOAP WSLD: based on default and simple B2B WSDL with just a SOA Header and a AnyType Body;
  2. Customized WSLD: you will need to upload your own customized WSDL to B2B that may content a richer payload structure.

Create a Web Service Listening Channel

The steps to create a new SOAP Listning Channel are similar to the steps to create any new Listening Channel: 
  1. Administration > Listening Channels
  2. Add a new Listening Channel
  3. Set the Name and the Type to Generic WS-1.0

Now is time to configure the listening channel based in your options.


Generic B2B WSDL

Using the generic WLSD SOAP is probably the quickest and easiest way to provide a Web Service interface to your partners. It relies on a default WLSD that accepts an AnyType, therefore accepts anything as a payload (e.g. HL7, EDI, XML, etc). 

For that you just have to select Use Generic SOAP and pick the default Service and Port. The endpoint URL are the one specified. Be sure that the Channel is Enabled at the Channel Attributes tab and you are good to go.

Access your SOAP Web Service at: 

http://<hostname>:<port>/b2b/services/ws/MyCompany_ListeningChannel

Customized WSDL

The second option is to use a customized WSDL on your own. Depending on the complexity of your payload you may have to create new B2B messages to be able to expose your service correctly.

To create a customized SOAP WS Listening Channel you have to upload your WSDL file. You can import an WSDL having the inbound/outbound messages defined either in an schema inside the WSLD itself or upload a ZIP file containing various dependent XSDs or WSDLs files imported by the WSDL file.

These are the steps for uploading your WSDL:
  1. Administration > WSDL
  2. Click on the + button
  3. Specify a WSDL Name
  4. Browse and select the root WSDL

Once again, remember that you have to specify the body message as a new B2B document so B2B can process the document as any other document being received by B2B. 

Now its time to configure the Listening Channel, but this time using the uploaded WLSD

Select the Service and Port you want to expose (i.e. one WSDL can contain multiple services)



Securing the exposed Web Services

Finally, a very important action before you publish the services to your partner is to secure those services. Good news is that B2B integrates with the Oracle Webservice Manager product of SOA Suite. So, directly from the B2B console you can attach and detach WSM policies to your exposed services:

Select the policies to apply.


More details on how to use the Oracle Webservice Manager policies: https://docs.oracle.com/middleware/1212/owsm/

Handling your payload message

It is important to note that there is a feature on B2B that allows you to extract a raw payload (HL7, EDI, etc) from an element of a SOAP message. This comes very handy when you want to receive a raw message assigned to any element on a XML message.

The option is accessible from the Exchange Protocol Parameter tab of the created Listening Channel.




No comments:

Post a Comment