Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SOA 11.1.1.7 : How to pass a custom http header to a REST service from BPEL

akmandula-JavaNetJun 4 2015 — edited Feb 26 2020

Hello,

Using SOA 11.1.1.7.6

I am invoking a RESTful web service using POST, but it will need a custom HTTP header ( x-express-apiversion : 2.1 ) to be passed while invoking. I am able to test it in SOAP UI tool by setting the custom HTTP Header.

I am trying to do the same in BPEL 2.0 process using HTTP Binding Adapter, but could not find a way to set the custom HTTP header for invoking the REST service. 

In the Composite.xml file under the Reference

<property name="oracle.webservices.http.headers">x-express-apiversion</property>

In the BPEL Process, I have created a Variable for this Custom HTTP Header and assigned a value for it and then used it in the Invoke activity that is calling the REST service reference, but still it is failing and it looks like the HTTP header is not passed from BPEL to the external service


<copy>

      <from>"2.1"</from>

       <to>$xExpressAPIVersionVar</to>

  </copy>

<invoke name="Invoke_CreateOrder"

            partnerLink="EMetrixCreateOrderSvc" portType="ns1:createOrder_ptt"

            operation="createOrder"

            inputVariable="Invoke_CreateOrder_InputVariable"

            outputVariable="Invoke_CreateOrder_OutputVariable"

            bpelx:invokeAsDetail="no">

            <bpelx:fromProperties>

            <bpelx:fromProperty name="x-express-apiversion" variable="xExpressAPIVersionVar"/>

            </bpelx:fromProperties>

    </invoke>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

   <env:Header/>

   <env:Body>

      <env:Fault>

         <faultcode>env:Server</faultcode>

         <faultstring>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "http://hostnamexxxxx/ESMAPI/Order.svc/Purchase" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 400 Missing x-express-apiversion request header. API is version 2.1</faultstring>

         <faultactor/>

         <detail>

            <exception>Unable to invoke endpoint URI "http://hostnamexxxx/ESMAPI/Order.svc/Purchase" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 400 Missing x-express-apiversion request header. API is version 2.1</exception>

         </detail>

      </env:Fault>

   </env:Body>

</env:Envelope>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2015
Added on Jun 4 2015
3 comments
2,529 views