Important Update: Community URLs redirect issues are partially resolved. Learn More. .

Showing results for 
Search instead for 
Did you mean: 

SOAP call from programmatically (JS) --- Status = 0

Contributor III

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.


<?xml version="1.0" encoding="utf-8"?>
    <CreateUserSessionFromInstance xmlns="">

Not applicable

That is good documentation but it doesn't resolve my issue. The above code is ran in POSTMAN and returns a session token but when used in a Node.js script I get a status = 0.

Is there something I may be missing?

Not applicable

In NODE JS did u try REST authentication call? Also it depends on what is your complete code. I remember I was able successfully using Eclipse EE+NodeJS for API calls to Archer, though long time ago.

Thanks for getting back to me so quickly on this. 

My complete code is below. I am running in VSCode with the node modules. I have ran this successfully in other instances but not with an xml call like mentioned and not to ARCHER API.


var XMLHttpRequest = require('xhr2');
var xmlhttp = new XMLHttpRequest();

// build SOAP request
var sr =
'<?xml version="1.0" encoding="utf-8"?>' +
  '<soap:Body>' +
    '<CreateUserSessionFromInstance xmlns="">' +
      '<userName>username</userName>' +
      '<instanceName>50000</instanceName>' +
      '<password>password</password>' +
    '</CreateUserSessionFromInstance>' +
  '</soap:Body>' +

xmlhttp.onreadystatechange = function () {
    if (xmlhttp.readyState == 4) {
        console.log("- status: " + xmlhttp.status);
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
console.log("- sending token request...");


Not applicable

I was using either ajax or require libs, I remember.

Also, are u sure your credentials correct and XML request correct by using Jeff's tool or postman? Like to be sure that there is no issue with domain, credentials, API node in IIS, etc.

Not applicable

And address your URL not to ?WDSL but only general.asmx. Because if you use ?WDSL, you are using SOAP 1.1 which requires SOAPAction in the header:


So, main recommendation, define header as in the Archer Help above, and user URL:

Made the recommended changes and same result.

My POSTMAN call does not have headers except for content type and works great.

code changes added headers...

xmlhttp.setRequestHeader('POST', '/archer/ws/general.asmx HTTP/1.1');
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.setRequestHeader('SOAPAction', '');
the host and content length were not accepted.

Not applicable

Did u use different URL by removing ?WDSL?

Yes and that does work in POSTMAN but not in my code call.