1 Reply Latest reply on Jun 12, 2019 9:51 AM by Martien van den Akker

    Reference soap with header

    HaniYS

      Hi

       

      I use JDeveloper 12.2.1, i create mediator for soap reference web service, the reference web service expect header x-CentraSite-APIKey, how can i pass it from mediator?

      Below describe web service and soapUI call with expected header

       

      2.png

       

      3.png

        • 1. Re: Reference soap with header
          Martien van den Akker

          Hi Hani,

           

          I think this article of Edwin Biemond desribes it nicely for BPEL: Java / Oracle SOA blog: Retrieve or set a HTTP header from Oracle BPEL

          I haven't got a proper example of a Mediator doing the same. But I played around a with an example of a service I have.

          I added the property <property name="oracle.webservices.http.headers">username,message,message2</property> to my reference.

          Then in the Mediator, I clicked on the assign button, below the transformation button and opened the properties node. I assigned a dummy value to the wsa.messageid, then I switched to the source of the mediator component:

           

          I also added an assignment to the remoteAddress property:

          In the source this becomes:

          In your case I would try to add <property name="oracle.webservices.http.headers">x-CentraSite-APIKey</property> to the webservice reference. Add an assignment to a transport.http.remoteAddress  property like I did.

          Then I would try to change $out.property.transport.http.remoteAddress to $out.property.transport.http.x-CentraSite-APIKey and see what it does. If that does not do the trick, try simply $out.property.x-CentraSite-APIKey.

           

          Could you report back if this worked?

           

          Regards,
          Martien

          1 person found this helpful