直到现在我还没有用过肥皂。我正在使用 node-soap 库(https://github.com/vpulim/node-soap)。
我想与肥皂服务器通信。为了维护会话,服务器向我发送 set-cookie 响应标头:'ASP.NET_SessionID=55....hrc; path/; HttpOnly'
带有 Login 方法响应。我想在注销方法请求中将此 cookie 发回。
我尝试:client.addHttpHeader('Cookie', 'ASP.NET_SessionID=55....hrc');
但在随后:
client.LogoutAsync({})
.then(result => {console.log(result);})
.catch(error => {console.log(error);});
我收到一个错误:
events.js:183 throw er; //Unhandled 'error' event
这是怎么回事,我怎样才能发回 Cookie 标头?
PS Wihtout cookie 它按预期工作返回 me Logout: false
,这意味着发生错误是因为它无法识别会话(我想)。