Labels

Monday, February 24, 2014

How to set URI and Authentication Credentials to Partner Link Dynamically!

Oracle BPEL is a pain to deal with when trying to have a full control of the header and authentication. This will show you a simple way to set the HTTPAdapter URI and Credential for the Basic Authentication. You can set the URI dynamically using the endpointURI as it will allow you to overwrite it with a variable at run time. The same we like to also get the username/password to also be passing in at runtime. Oracle has a set of headers properties that you can set, but statically are:
oracle.webservices.auth.username
oracle.webservices.auth.password
But the problem, come when you attempt to overwrite these values with your own at runtime the BPEL simple ignore it.
To solve this problem, we will have to force the HTTPAdapter to use the good old javax.xml.ws.security.auth.username and password method of passing the basic credential, because the Oracle BPEL will not reject the toProperty setting in the BPEL. Here are the three headers properties that allow data to be replaced at runtime just before invoke.
endpointURI
javax.xml.ws.security.auth.username
javax.xml.ws.security.auth.password
[composite.xml]

 true
 bogus
 bogus
 DEFAULT
 30000
 WSDLDriven
 GET
 https://testsvr.cnci.org/test/products
 url-encoded
 
BPEL Dynamic URI and Credentials composite [yourBPEL.bpel]

 
 
 



 ...



    
    
    

BPEL Dynamic URI and Credentials bpel.xml

No comments:

Post a Comment