Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2023-01-26 09:06 AM - edited 2023-01-26 01:18 PM
Attempting to get a session token, but I am not getting any data back. I am using below xml call in a JavaScript node.js setup.
When I run in POSTMAN I get the token as expected.
I am getting a status 0 in the script.
2023-01-26 03:16 PM
This is what I used in the past. The only difference is for the POST it's on the open and not setting a request header.
var xmlObj = getXMLHttpRequest();
xmlObj.open ( "POST", "/ws/general.asmx", false)
xmlObj.setRequestHeader("Content-Type", "text/xml");
xmlObj.setRequestHeader("SOAPAction", "http://archer-tech.com/webservices/CreateUserSessionFromInstance");
xmlObj.send("<?xml version='1.0' encoding='utf-8'?> \
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
<soap:Body> \
<CreateUserSessionFromInstance xmlns='http://archer-tech.com/webservices/'> \
<userName>**USERNAME**</userName> \
<instanceName>**INSTANCE**/instanceName> \
<password>**PASSWORD**</password> \
</CreateUserSessionFromInstance> \
</soap:Body> \
</soap:Envelope> \
");
xmlObj.close;
Advisory Consultant
2023-01-26 03:28 PM
I get the same result status = 0.
The only difference I see is that I require 'xhr2' for the XMLHttpRequest
and the open is set to true vs false - if set to false like yours I get an error.
2023-01-26 05:11 PM - edited 2023-01-26 05:11 PM
Out of curiosity, I copied David's code and executed. it run fine and returned 200 with session token response.
1 comment I can make, maybe your /ws node is located under /RSAarcher? So your full URL would be https://cms-uatw2019.bankofamerica.com/RSAarcher/ws/general.asmx
However, if the same exact URL is working for you in POSTMAN, then it should not be the case. Nevertheless, David's code is certainly working.