Followers

Sunday, December 29, 2013

Invoking specific operation in a WS in BPEL

Invoking specific operation in a WS in BPEL

If a WS has multiple operations and if you want to invoke a particular operation from a BPEL invoke activity, the process is no different than invoking a simple WS with one operation.
Steps:
  1. Create an external reference for the WS by drag/dropping the WebService component from the component pallete to the SOA Composite and select the wsdl of the appropriate WS. I assume the WS is already deployed.
  2. Create a BPEL process and create a wire between the BPEL and the WS.
  3. With this, a partner link is created in the .bpel file.
  4. Create an invoke activity in the BPEL process and wire to the partner link. In the Edit Invoke popup, under the partner role, you can find the operation dropdown from which you select the appropriate operation. Based on the operation selected, the variable gets created(just in case you opt to automatically create a new one).

Invoking a Secured WebService in BPEL - Oracle SOA Suite 11g


No Webservice in real-world business applications is just exposed as it is, Security is enabled inherently
Oracle Fusion Middleware uses a policy-based model to manage and secure Web services across an organization
Policies apply security to the delivery of messages
Policies can be managed by both developers in a design-time environment and system administrators in a runtime environment
Below are the steps to invoke a secured WebService from a BPEL Process
  1. Before we start, we have to know what is the security policy imposed by the WebService. In this example, we are considering a WebService that has oracle/wss_username_token_client_policy
  1. There are 2 ways of imposing security for services in Oracle SOA Suite 11g
    1. Design Time
      1. Simply, rt click on the web service reference --> Configure WS Policies --> Select the appropriate Policy
Please note that you can select multiple policies at once, depending on the security of the WebService
This step adds the following snippet
      <wsp:PolicyReference URI="oracle/wss_username_token_client_policy" orawsp:category="security" orawsp:status="enabled"/>
  1. Run Time
    1. The same could be done at runtime using Enterprise Manager(EM)
Login to EM --> rt click on soa_infra --> configure Policies --> select the appropriate Policy
The above step creates a 'Lock' icon on top of the web service reference as shown above
  1. Open composite.xml, goto source view, find out the reference tag in the file and add the following snippet which basically tells that this particular reference is secured with so-and-so policy, and these are the credentials for invoking the same
      <property name="oracle.webservices.auth.username" type="xs:string"
                many="false" override="may">admin</property>
      <property name="oracle.webservices.auth.password" type="xs:string"
                many="false" override="may">Welcome123</property>

Partnerlinks in Oracle SOA Suite 11g

Links to all the wsdl-driven services in a composite that BPEL interacts with, are called Partner Links.
They are the references to the actual implementations, through which the BPEL process interacts with the external world(services).
Invoked Partner Links : Links to services that are invoked by the BPEL process.
Clinet Partner Links : Links to services that can invoke a BPEL process.
In otherwords, all outward(to the BPEL process) links can be called as invoked partnerlinks and inward links can be called as client partner links.
<PartnerLinkType>
A partner link type defines how two individual WSDL-defined partners can interact together and what each of the partners have to offer.
Is defined in the wsdl of the services thru the WSDL extensibility mechanism.
It is included in the wsdl file of every service involved in the BPEL process.
It identifies the portType element referenced by the partnerLink in the process .bpel file.
 
Example:
In wsdl,
  <plink:partnerLinkType name="ABCPartnerLink">
    <plink:role name="SomeService"
                portType="ns:SomeServicePortType">
    </plink:role>
  </plink:partnerLinkType>
The <PartnerLinkType> element contains <role> element that the service provider or consumer can play, as defined in the <PartnerLink> element of the .bpel file
<PartnerLinks> are defined in the .bpel file.
Defines portType of the partner process that will participate in the BPEL process.
Contains myRole and partnerRole attributes, which relate to the <role> element in the
wsdl file's <PartnerLinkType>
A BPEL can interact with the services in 3 ways
  1.  Services that invoke a BPEL process
  2.  Services that are invoked by the BPEL process
  3.  Services that act both ways
Need Review:
The client role represents the requestor of the service. Basically used for the callback.

No comments:

Post a Comment