Friday, June 18, 2010

Passing Userid and Password Credentials as SOAP Header in BPEL

Problem
There may be Services that have policies enforced to receive the userid/password as part of the requests. If you do not have a Service Bus then this informaton has to be passed from the BPEL.


Solution

  1. Right click on the Web Service in Composite Design view
  2. Select "Configue WS Policies"
  3. Add Client Security Policy as applies to your case. I had to us "oracle/wss_http_token_client_policy"
  4. Add the following Binding Properties from the Property Inspector
    1. "oracle.webservices.auth.username" : admin
    2. "oracle.webservices.auth.password" : admin
If you look at the source generated in the composite .xml, you would see the following


  <reference name="...Service" ui:wsdlLocation="....wsdl">
    <interface.wsdl  ...../>
    <binding.ws port="....."
    
      <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">admin</property>




    </binding.ws>
  </reference>

1 comments:

  1. Would this work, if I need to pass in additional parameter or property via the SOAP header, say something like "RepositoryName"?

    ReplyDelete