Thursday, September 13, 2012

SOA 11g BPEL SOAP Header

I was trying to add complex element as mentioned below in soap header in SOA 11g BPEL process as below.

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
   <env:Header>
      <wsa1:OIMUser  xmlns:wsa1="http://xmlns.oracle.com/OIM/provisioning">
         <wsa1:OIMUserId>**</wsa1:OIMUserId>
         <wsa1:OIMUserPassword>**</wsa1:OIMUserPassword>
      </wsa1:OIMUser>
   </env:Header>
   <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <processRequest xmlns="http://xmlns.oracle.com/OIM/provisioning">
         <sOAPElement xmlns="">

  • Basically started with new XSD as below:

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/OIM/provisioning"
            targetNamespace="http://xmlns.oracle.com/OIM/provisioning"
            elementFormDefault="qualified">
  <xsd:element name="OIMUser" type="OIMUserType"/>
  <xsd:complexType name="OIMUserType">
        <xsd:sequence>
            <xsd:element name="OIMUserId" type="xsd:string"/>
            <xsd:element name="OIMUserPassword" type="xsd:string"/>
        </xsd:sequence>
  </xsd:complexType>
</xsd:schema>


  • Created a variable Header of element OIMUser:



  • Configured the Invoke Activity with Header variable 
 

  • This generated following activity in source code
    <invoke name="Invoke"
            partnerLink="OIMProvisioning" portType="ns1:OIMProvisioningPort"
            operation="processRequest" inputVariable="OIMInput"
            outputVariable="OIMOutput" bpelx:invokeAsDetail="no"
            bpelx:headerVariable="Header"

  • This didn't work as per testing with TCPMon, had to change headerVariable with inputHeaderVariable manually in source code to make it work
    <invoke name="Invoke"
            partnerLink="OIMProvisioning" portType="ns1:OIMProvisioningPort"
            operation="processRequest" inputVariable="OIMInput"
            outputVariable="OIMOutput" bpelx:invokeAsDetail="no"
            bpelx:inputHeaderVariable="Header" 

















2 comments:

Lakesh said...

Nice artical. spent lot of time on this. finally succeeded after looking at your artical. Thank you

Unknown said...

HI,
What about trying to get the header when the service provider replies. It has the attribute bpelx:outputHeaderVariables on the invoke. Can you try?