Workflow soap call via JS doesn't work through campaign but same works from SOAP UI
Sample JS file added below which is causing the error. Could someone help to fix this issue?
This SOAP request get success while trying from a SOAP UI
xtk.workflow.Cleanup(instance.id);
var req = new HttpClientRequest("https://xxxxx/test/ws");
logInfo("Connection establish..");
req.header["Content-Type"] = "text/xml; charset=utf-8";
req.header["SOAPAction"] = "";
req.header["Host"] = "xxxxx";
req.method = "POST";
logInfo("All parameters set");
req.body = '<soapenv:Envelope xmlns:sms="/sms" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'+
' <soapenv:Header><wsse:Security 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-xxxx"><wsse:Username>UserWs</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">xxxx=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xxxx==</wsse:Nonce><wsu:Created>2020-03-13T10:30:36.407Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>'+
'<soapenv:Body>'+
'<sms:sendSmsRequest>'+
'<sms:fieldsTemplate>'+
'<sms:id>lang</sms:id>'+
'<sms:value>nl_NL</sms:value>'+
'</sms:fieldsTemplate>'+
'</sms:sendSmsRequest>'+
'</soapenv:Body>'+
'</soapenv:Envelope>';
logInfo(req.body);
req.execute();
logInfo("Req executed")
var resp = req.response;
var xmlRes = new XML(String(resp.body).replace("<?xml version='1.0'?>",""));
logInfo(xmlRes)
//cnx.dispose();
Audit log
03/17/2020 8:43:35 AM Workflow finished
03/17/2020 8:43:35 AM js tion is org.apache.wss4j.common.ext.WSSecurityException: The message has expired</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
03/17/2020 8:43:35 AM js <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Client</faultcode> <faultstring xml:lang="en">The message has expired; nested excep
03/17/2020 8:43:35 AM js Req executed
03/17/2020 8:43:35 AM js INT-150012 The HTTP query returned a '' type error (500)
I already added the entry under in serverconf.xml
</urlPermission>
<url dnsSuffix="xxxx" urlRegEx="https://.*" />
</urlPermission>
Does the timezone difference in our server and the req.header["Host"] = "xxxxx"; server makes this kind of problem ?