Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello,
While consuming web service which returns XML, I am getting below error:
Application log:
[context: com.thingworx.webservices.context.HttpExecutionContext@4d1285e][message: Execution error in service script [test2] :: Connect to www.holidaywebservice.com:80 [www.holidaywebservice.com/50.62.169.119] failed: Connection refused: connect]
Service Code:
var params1 = {
proxyScheme: undefined /* STRING */,
headers: undefined /* JSON */,
ignoreSSLErrors: undefined /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
withCookies: undefined /* BOOLEAN */,
proxyHost: undefined /* STRING */,
url: "http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx/GetCountriesAvailable?CountryCode=Canada" /* STRING */,
timeout: undefined /* NUMBER */,
proxyPort: undefined /* INTEGER */,
password: undefined /* STRING */,
domain: undefined /* STRING */,
username: undefined /* STRING */
};
// result: XML
var resultXML = Resources["ContentLoaderFunctions"].GetXML(params1);
var params2 = {
infoTableName : "InfoTable",
dataShapeName : "SOAP_DataShape"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(StringDataShape)
var result1 = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params2);
for each (var tag in resultXML.*::HolidayCode) {
var newRow = new Object();
newRow.HolidayCode = tag.*::Code;
newRow.Description=tag.*::Description;
result1.AddRow(newRow);
}
result=result1;
I am using TWX 8.2.1, any suggestion?
Thanks!
It says Connection refused, did you try this with something like Postman and did it work with Postman?
Connection Refused probably means you aren't calling the right end point or it doesn't like where the call is coming from.
Its working with postman and soap UI. But in thingworx whatever url I give it says refuced to connect except localhost.
Do we have node js plugin for thingworx.
I've tested on my side and it works, I think that you have a problem with your server which isn't allowing outgoing communications (maybe you ha firewall rule or alike)
Hope you are doing good. Could you please confirm if the issue has been resolved.
If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.
Regards-Mohit Goel