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!

Username creation using PAPI-WS code

user647659Sep 3 2009 — edited Sep 8 2009
Hi all,
I am testing the code in the online example for PAPI-WS i.e. BPM-PapiWs-JaxWs-Example.... I have my process running and PAPI Web Services started.. I have my username and password as test , test...

I am getting errors in username password authentication... I cannot authenticate my participant... The error that I am getting is on the following line:-
Header header = Headers.create(security);

Can somebody explain me the code in the example:-

private static final String SECURITY_NAMESPACE =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";

private static void addUsernameTokenProfile(PapiWebService papiWebServicePort)
throws SOAPException {
SOAPFactory soapFactory = SOAPFactory.newInstance();
QName securityQName = new QName(SECURITY_NAMESPACE, "Security");
SOAPElement security = soapFactory.createElement(securityQName);
QName tokenQName = new QName(SECURITY_NAMESPACE, "UsernameToken");
SOAPElement token = soapFactory.createElement(tokenQName);
QName userQName = new QName(SECURITY_NAMESPACE, "Username");
SOAPElement username = soapFactory.createElement(userQName);
username.addTextNode("test");
QName passwordQName = new QName(SECURITY_NAMESPACE, "Password");
SOAPElement password = soapFactory.createElement(passwordQName);
password.addTextNode("test");
token.addChildElement(username);
token.addChildElement(password);
security.addChildElement(token);
Header header = Headers.create(security);
((WSBindingProvider) papiWebServicePort).setOutboundHeaders(header);
}



I understand that this code adds a Username Token Profile.. But I am not clear how does it do that... Can somebody explain and explain me what is the reason behind the error on the line Header header = Headers.create(security); ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2009
Added on Sep 3 2009
8 comments
1,736 views