Expand my Community achievements bar.

SOLVED

Workflow soap call via JS doesn't work through campaign but same works from SOAP UI

Avatar

Level 1

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:UsernameTo... 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">x... EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xxxx...
'<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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 9

The 500 error is coming from your destination system. It looks like your request is working but the system you are requesting data from is throwing a 500 error. The hints will be in the nested exception details.

Issues like this during auth can occur when system clocks are out by too much, etc

I would contact the admin for the SMS system you are trying to send messages through and debug from there

View solution in original post

4 Replies

Avatar

Level 1
Does the timezone difference in our server and the req.header["Host"] = "xxxxx"; server makes this kind of problem ?

Avatar

Correct answer by
Level 9

The 500 error is coming from your destination system. It looks like your request is working but the system you are requesting data from is throwing a 500 error. The hints will be in the nested exception details.

Issues like this during auth can occur when system clocks are out by too much, etc

I would contact the admin for the SMS system you are trying to send messages through and debug from there

Avatar

Level 1

Hi Darren,

 

But this same request works fine from the SOAP UI that confuses me. 

"System clocks are out by too much" by this do you mean my campaign on-premise server timezone and the SMS system server timezone might be different..

 

Regards

Aneesh

Avatar

Level 9
Yes this could be your issue. When you google the error message "The message has expired;" you get results like this: https://community.smartbear.com/t5/SoapUI-Open-Source/The-message-has-expired/td-p/103117