Client opened session with ID 1 but the SOAP header targets session with ID 2!
We are calling IDS from a nodejs app using the "node-soap" component. We are now introducing sessions and encountering the issue.
I just stared a session and tried to close it. Always get error message inside the event soapError saying "Client opened session with ID 1 but the SOAP header targets session with ID 2!" .If I try to run it again I get error "Client opened session with ID 1 but the SOAP header targets session with ID 3!". Tried runscript() also , It ran successfully but still get the error message.
I use indesign server 2015.
Please see the code which I use,
var soap = require("soap");
var url = "http://localhost:8194/wsdl?wsdl";
var args = { "IDSP:runScriptParameters":
{
"scriptLanguage": "javascript",
"scriptFile": scriptPath,
"IDSP:scriptArgs" : [
{ "IDSP:name" : "user",
"IDSP:value" : thisUser}
]
}
};
soap.createClient(url, function(err, client) {
client.on("soapError", function(err) {
console.log(err.message);
return errDataCallback(soapErr);
});
var sessionId;
client.BeginSession(function(err,session,test1){
sessionId = session.sessionID;
console.log("sessionID : "+sessionId);
if(err){
return errDataCallback(err);
}
var result = client.addSoapHeader({"sessionID":sessionId},"sessionID","IDSP","");
var sessionArg = { "IDSP:sessionID": sessionId.toString()};
client.EndSession(sessionArg, function(err){
console.log(err.message);
});
});
});
Please help me to resolve the issue.
