Hello Team,
I am using SOAP plug-in (1.0.3 ) with VMware vCenter Orchestrator 5.5. From Orchestrator Client, I am trying to invoke an operation by SOAP request. The operation was invoked successful when there was no security information passing to soap header. But issue occured when I tried to put a custom header ("UsernameToken") in the SOAP request via SOAP Interceptor class and execute the workflow. Please see below the code snippet which I am using in my Workflow.
Can you please check and let me know if anything more need to pass in SOAP request header ?
Also, please let me know if you need anything more from my side.
#################################Code Snippet in Workflow###################################
//Added for SOAP Interceptor [Starts]...............
var interceptor = new SOAPInterceptor();
interceptor.setRequestHeaderInterceptor(requestHeaderHandler);
interceptor.setRequestBodyInterceptor(requestBodyHandler);
function requestHeaderHandler(content) {
System.log("This is the request header: '" + content + "'");
// process & return your header here
var content =
"<Security xmlns='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>" +
"<UsernameToken>" +
"<Username>xxxxxx</Username>" +
"<Password>xxxxxxx</Password>" +
" </UsernameToken>" +
"</Security>";
System.log("This is the request custom header : '" + content + "'");
return content;
}
function requestBodyHandler(content) {
System.log("This is the request body: '" + content + "'");
// process & return your header here
}
var response = operationtype.invokeWithInterceptor(request, interceptor);
#################################################################################
Error in the Workflow log and as well as server log.
########################################################
- An error was discovered processing the WS-Security header
<faultcode>wsse:InvalidSecurity</faultcode>
<faultstring>An error was discovered processing the WS-Security header</faultstring>
<detail>No certificate(s) found in WS-Security profile</detail>
#########################################################
Even I am trying to invoke the request from SOAP_UI and getting the same exception: Please see below the SOAP_UI request and response.
SOAP_UI request:
**********************************************************************
<soapenv:Envelope xmlns:inc="http://www.service-now.com/incident" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" 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 wsu:Id="UsernameToken-43298AF64B6243FA5D14524901201551">
<wsse:Username>deepak</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">NFK8HfW+302OJj40Tl4g9Gu+UsU=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">QB9tbUyepZSxuN1JSUkQZA==</wsse:Nonce>
<wsu:Created>2016-01-11T05:28:40.153Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<inc:insert>
<inc:comments>Test</inc:comments>
<inc:description>Test Insert Incident</inc:description>
<inc:number>INC000000222</inc:number>
<inc:short_description>Test Insert Incident Short Description</inc:short_description>
<inc:work_notes>Test Work Notes</inc:work_notes>
</inc:insert>
</soapenv:Body>
</soapenv:Envelope>
*******************************************************************
SOAP_UI Response:
****************************************************************
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>wsse:InvalidSecurity</faultcode>
<faultstring>An error was discovered processing the WS-Security header</faultstring>
<detail>No certificate(s) found in WS-Security profile</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
******************************************************************
Thanks,
Koushik