1

I'm using Oracle BPEL 12c to develop a process.

I need to call a external service with basic authentication. I need to pass the credentials received on my exposed service endpoint to the external service.

When i call, i receive this:

<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="summary">
<summary>
oracle.fabric.common.FabricException: oracle.fabric.common.FabricException: Error in getting XML input stream:XXXXXX?WSDL: Server Authentication Required: Error in getting XML input stream: XXXX?WSDL: Server Authentication Required
</summary>
</part>
-<part name="detail">
<detail>Server Authentication Required</detail>
</part>
</remoteFault>

I tried to define on the composite, also the oracle.webservices.auth.password and oracle.webservices.auth.username password for the external service.

Also the javax.xml.ws.security.auth.username and javax.xml.ws.security.auth.password properties without sucess.

Any sugestion?

Kind regards, Ricardo

Ricardo
  • 612
  • 2
  • 9
  • 16

1 Answers1

2

I suppose your composite snippet should look like this:

<reference name="Service1" ui:wsdlLocation="test1.wsdl">
    <interface.wsdl  interface="http://tempuri.org/#wsdl.interface(IService1)"/>
    <binding.ws port="http://tempuri.org/#wsdl.endpoint(Service1/BasicHttpBinding_IService1)"  location="test1.wsdl" soapVersion="1.1">
        <property name="weblogic.wsee.wsat.transaction.flowOption" type="xs:string" many="false">WSDLDriven</property>
        <property name="oracle.webservices.auth.username" type="xs:string" many="false">test</property>
        <property name="oracle.webservices.auth.password" type="xs:string" many="false">password</property>
        <property name="oracle.webservices.preemptiveBasicAuth" type="xs:string" many="false">true</property>
    </binding.ws>
</reference>

And also good practice to use variables when defining user and password instead of explicitly username and password

    <property name="oracle.webservices.auth.username" type="xs:string" many="false">{$username}</property>
     <property name="oracle.webservices.auth.password" type="xs:string" many="false">{$password}</property>

and then override them in generated cfg_plan.xml while deploying composite application

 <reference name="Service1">
     <!--Add search and replace rules for the binding properties-->
     <binding type="ws">
        <attribute name="port">
           <replace>{your_port}</replace>
        </attribute>
        <attribute name="location">
           <replace>{your_location}</replace>
        </attribute>
        <property name="weblogic.wsee.wsat.transaction.flowOption">
           <replace>WSDLDriven</replace>
        </property>
        <property name="oracle.webservices.auth.username">
           <replace>test</replace>
        </property>
        <property name="oracle.webservices.auth.password">
           <replace>password</replace>
        </property>
        <property name="oracle.webservices.preemptiveBasicAuth">
           <replace>true</replace>
        </property>
     </binding>
  </reference>
Iurii Kvashuk
  • 389
  • 2
  • 15
  • Thanks for your reply Yuryi Kvashuk. Actually the properties are: test pass Yes that works for a static user, that i can simple override. But the ideia is to : ->Pass the basic auth from the Service input to the Reference backend (invoked inside the bpel), so the same user that call the service will also call the back end (Propagate the basic the service to the client). – Ricardo Nov 13 '17 at 18:30
  • 2
    It depends on how are going to be passed basic auth parameters to the service, e.g. it can be implemented the following way. The first step, to add a property to with a name oracle.webservices.http.headers and values: name="oracle.webservices.http.headers">username,password. – Iurii Kvashuk Nov 14 '17 at 09:32
  • 2
    Then, in order to pass parameters into a reference, it is needed to add the following properties(if bpel is being used in this case): testpass into the invoke Activity of BPEL Process – Iurii Kvashuk Nov 14 '17 at 09:33
  • 2
    You can find a good explanation here(how to pass parametes from service): http://biemond.blogspot.ru/2012/04/retrieve-or-set-http-header-from-oracle.html – Iurii Kvashuk Nov 14 '17 at 10:48
  • Hi Yuryi! Thanks for your Answers! I was able with your help to perform the thing i needed. Kind Regards – Ricardo Nov 17 '17 at 11:47