Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _call.setOperation(_operations[0]);
- _call.setUseSOAPAction(true);
- _call.setSOAPActionURI("process");
- _call.setEncodingStyle(null);
- _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
- _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
- _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
- _call.setOperationName(new javax.xml.namespace.QName("", "process"));
- //Introducir la cabecera de seguridad
- try{
- SOAPHeaderElement elSec1 =
- (SOAPHeaderElement)WSSecurityUtils.createWSSecurityHeader(usuario, password, true);
- _call.addHeader(elSec1);
- setRequestHeaders(_call);
- setAttachments(_call);
- donde
- public static SOAPHeaderElement createWSSecurityHeader (String pUsername,
- String pCredential,
- boolean pIsWSPolicyCompliant)
- throws SOAPException
- {
- SOAPHeaderElement elWsSecurity =
- new SOAPHeaderElement(SEC_NAMESPACE_OASIS , SECURITY);
- // ws policy
- elWsSecurity.setMustUnderstand(pIsWSPolicyCompliant);
- elWsSecurity.setPrefix(PREFIX);
- // this is the username token (wsse:UsernameToken)
- SOAPElement seToken = elWsSecurity.addChildElement(USERNAMETOKEN);
- SOAPElement seTokenUser = seToken.addChildElement(USER);
- seTokenUser.addTextNode(pUsername);
- if (pCredential != null) {
- SOAPElement seTokenPassword = seToken.addChildElement(PASSWORD);
- seTokenPassword.addTextNode(pCredential);
- }
- return elWsSecurity;
- }
Add Comment
Please, Sign In to add comment