how to pass login credentials dynamically to secured partnerlink in a BPEL
678455Jun 2 2009 — edited Jun 4 2009Hi,
I am trying to invoke a secured web service from a BPEL.And requirement is to dynamically pass the username and password . I have done the following steps to pass the login credentials to the partner link.
Infact I have followed one of the oracle forums.BUT ITS NOT WORKING.
====================================================================================================
1. Imported the xml schema "oasis-200401-wss-wssecurity-secext-1.0.xsd"
2. Created a variable "SecurityContext"
<variable name="SecurityContext" element="ns2:Security"/>
3.Created a copy rule.
<copy>
<from>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>myusername</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">mypassword</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</from>
<to variable="SecurityHeader"/>
</copy>
4. Added the following xml to the invoke operation.
<invoke name="Invoke_1" partnerLink="UnitHealthService"
portType="ns1:UnitHealth" operation="queryUnitHealthInfo"
inputVariable="Invoke_1_queryUnitHealthInfo_InputVariable"
outputVariable="Invoke_1_queryUnitHealthInfo_OutputVariable"
bpelx:inputHeaderVariable="SecurityContext"/>
5. Deployed the BPEL sucessfully.
6. Output message given by BPEL console is
<Faulthttp://schemas.xmlsoap.org/soap/envelope/>
<faultcode>env:Server</faultcode>
<faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is a28500bf6f4d1dc9:- 488f4503:1215f79430f:-7d71. Please check the process instance for detail.</faultstring>
</Fault>
7. In the VISUAL flow diagram , message generated by the Invoke activity is as below:
<summary>exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 401 Unauthorized</summary>
So FINALLY ITS NOT CONNECTING.
====================================================================================================
When I created the properties and hardcoded the username and password like below, its worked.
<property name="basicHeaders">credentials</property>
<property name="basicUsername">myusername</property>
<property name="basicPassword">mypassword</property>
Can anyone suggest HOW CAN I DYNAMICALLY PASS USERNAME AND PASSWORD to the secured web service via partner link??
Thanks,
Kumar