Oracle SOA 12.1.3 invoke external service with additional SOAP headers — oracle-tech

    Forum Stats

  • 3,701,027 Users
  • 2,239,262 Discussions
  • 7,834,978 Comments

Discussions

Oracle SOA 12.1.3 invoke external service with additional SOAP headers

31466703146670 Posts: 47
edited January 21 in SOA Suite Discusssions

I have a business scenario where I have to invoke a client SOAP service that uses additional SOAP header parameters. When I test the web service independently via SOAP UI it shows below schema as input-

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://xmlns.client.org/Schema/Common/1.0/Common.xsd" xmlns:user="http://xmlns.uppcl.org/Schema/UserAccess/2.0/UserAccess.xsd">

   <soapenv:Header>

   <wsse:Security xmlns:wsse="http://docs.demo-open.org/wss/2004/01/demo-200401-wss-wssecurity-secext-1.0.xsd">

         <wsse:UsernameToken xmlns:wsu="http://docs.demo-open.org/wss/2004/01/demo-200401-wss-wssecurity-utility-1.0.xsd">

            <wsse:Username>DemoUser</wsse:Username>

            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">[email protected]</wsse:Password>

         </wsse:UsernameToken>

      </wsse:Security>

      <com:TransactionReference>

         <com:SourceSystemId>TXNSYSID</com:SourceSystemId>

         <com:TxID>0403216376127836</com:TxID>

         <!--Optional:-->

         <com:BusinessID>DTUIQS</com:BusinessID>

      </com:TransactionReference>

   </soapenv:Header>

   <soapenv:Body>

      <user:CheckUserRequest>

         <user:UserId>USER_ID</user:UserId>

      </user:CheckUserRequest>

   </soapenv:Body>

</soapenv:Envelope>

As we can see additional header elements wsse:Security > UsernameToken  > Username/Password , TransactionReference > SourceSystemId / TxID / BusinessID as XML node.

Further, When I configured the SOAP adapter in a SOA composite but it has only one input argument UserId. Now I am not able to figure out how can I pass additional parameters (username/password, SourceSystemId / TxID / BusinessID  ) in SOA Header for target web service invocation in my SOA composite.

Tagged:
3146670

Best Answer

Answers

  • 31466703146670 Posts: 47
    edited June 2019

    Martien van den AkkerSrinivas Y please check and help me.

  • Martien van den AkkerMartien van den Akker Posts: 2,756 Bronze Crown
    edited June 2019 Accepted Answer

    Hi,

    I think this article describes it properly: https://sswaro.wordpress.com/how-to-use-soap-header-in-bpel/

    At least for your common.xsd based header. For the wsse:Security part, it should be possible to do the same. However, I'd recommend to take a look into OWSM and set the UserName token policy on your service: http://desarrolloconsoa.blogspot.com/2016/10/owsm-and-ws-security-username-token.html

    OWSM and WS-Security: Username Token Authentication for SOAP and REST Services in OSB 12c. (This is about OSB, but with SOA 12c it works about the same.)

    Regards,
    Martien

    3146670
  • 31466703146670 Posts: 47
    edited June 2019

    Martien van den Akker

    I am able to figure out the OWSM part. However I am still not able to figure out the way to pass below header parameters

    <com:TransactionReference>

             <com:SourceSystemId>TXNSYSID</com:SourceSystemId>

             <com:TxID>0403216376127836</com:TxID>

             <!--Optional:-->

             <com:BusinessID>DTUIQS</com:BusinessID>

          </com:TransactionReference>

    Whether I have to use the same XSD (used for OWSM Username/Password ) to include the SourceSystemId, TxID & BusinessID and follow the mechanism used for passing Username/Password as headers?

  • Martien van den AkkerMartien van den Akker Posts: 2,756 Bronze Crown
    edited June 2019

    Hi,

    Following the first blog I mentioned, you need to adapt your wsdl to include a wsdl:message based on the com:TransactionReference element. Then in the wsdl:binding on the input, you need to add a soap12:header based on that message and part="header":

    wsdl binding

    Since you're referencing a wsdl, I think you should take an abstract version of the referenced wsdl, and  create a wrapper wsdl that imports that abstract wsdl. And then in the wrapper wsdl, add a copy of the wsdl:binding and adapt that adding the header parts.

    In BPEL you need to create a variable based on the same element in the xsd (or maybe messagetype from the wsdl) and add those to the receive:

    receive header

    Or in your case: the invoke.

    Then in an assign you should set the header elements.

    But, do you happen to have OSB as well? Then you could consider using OSB as a gateway. Because then you can skip adapting BPEL. Create an OSB service with a proxy as well as the business service based on the exact same wsdl. Have BPEL call the OSB service and the OSB Service call the referenced service. On the OSB Business Service you can set the WS-Username/Token policy. And in the pipeline you can adapt the header variable to insert the com:TransactionReference element.

    Regards,
    Martien

    3146670
Sign In or Register to comment.