Thank You Andreas!
So far I have:
private OMElement createSecurityHeader(String username, String password) {
//OMNamespaceImpl wsseNS = new OMNamespaceImpl(WSSE_NS, WSSE_PREFIX);
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
OMNamespace namespaceWSSE = factory.createOMNamespace(WSSE_NS, WSSE_PREFIX);
SOAPEnvelope envelope = factory.getDefaultEnvelope();
//OMFactory factory = new SOAP11Factory();
// create the Security header block
//securityHeader = new OMElementImpl("Security", wsseNS, factory);
OMElement element = factory.createOMElement("Security", namespaceWSSE);
OMAttribute attribute = factory.createOMAttribute("mustUnderstand",
null, "1");
element.addAttribute(attribute);
Unsure how to store this in 'envelope'
Also what weblinks or books do you recommend?
Robert
________________________________
From: Andreas Veithen <[email protected]>
Sent: Thursday, September 7, 2017 11:52:55 AM
To: [email protected]
Subject: Re: [AXIOM] Migrating Java code from AXIOM 1.2.13 to 1.2.20
Use OMAbstractFactory.getSOAP11Factory() to get the SOAPFactory instance, then
rewrite your code to use the factory methods until there are no more references
to internal implementation classes. The resulting code will then work with both
Axiom versions.
Andreas
On Sep 7, 2017 4:46 PM, "Robert Seletsky"
<[email protected]<mailto:[email protected]>> wrote:
I have the following Java method using AXIOM 1.2.13:
private OMElement createSecurityHeader(String username, String password) {
OMNamespaceImpl wsseNS = new OMNamespaceImpl(WSSE_NS, WSSE_PREFIX);
OMFactory factory = new SOAP11Factory();
OMElementImpl securityHeader;
OMElementImpl usernameTokenElement;
OMElementImpl usernameElement;
OMElementImpl passwordElement;
// create the Security header block
securityHeader = new OMElementImpl("Security", wsseNS, factory);
securityHeader.addAttribute("mustUnderstand", "1", null);
// nest the UsernameToken in the Security header
usernameTokenElement = new OMElementImpl(USERNAME_TOKEN_LN, wsseNS,
securityHeader, factory);
// nest the Username and Password elements
usernameElement = new OMElementImpl(USERNAME_LN, wsseNS,
usernameTokenElement, factory);
usernameElement.setText(username);
passwordElement = new OMElementImpl(PASSWORD_LN,
wsseNS,usernameTokenElement, factory);
passwordElement.setText(password);
passwordElement.addAttribute(PASSWORD_TYPE_ATTR, PASSWORD_TEXT, null);
return securityHeader;
}
}
I want to migrate this code to work with AXIOM 1.2.20.
Looking for a solution and what resources are recommended to do this in general?
Robert
University of New Mexico IT