Discussion:
[nodejs] Node Soap - null response
s***@gmail.com
2018-04-09 09:11:18 UTC
Permalink
hi, i'm using a soap client for node.js found here:
https://www.npmjs.com/package/soap

I'm calling my method:
soapResult = sync.await(client.authenticate( methodArgs, sync.defer()));

but soapResult is null

However, when i take a look at client.lastResponse i can see the xml
response i would expect:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>123456789</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<authenticateResponse xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>


I'm wondering if soapResult is null because authenticateResponse is null,
and it expects the value to be there? The value is in fact returned in the
header, i want to return BinarySecurityToken but i'm not sure how.

thanks
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ebcd0788-701a-4aed-ad65-df67a8183bab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mikkel Wilson
2018-04-13 19:18:09 UTC
Permalink
client.authenticate doesn't appear to be a method in this library. It may
be making some kind of request that's populating lastRequest, but I think
you need client.setSecurity(). See the docs here for an example:
https://github.com/vpulim/node-soap#basicauthsecurity

I'd also suggest skip the `sync.await` library. I'm not sure what it's
doing but it may be why lastResult is populated but the response doesn't
come back as you'd expect. Try it first the normal async way, then
promisify it later when you're sure it works.

HTH,
Mikkel
https://www.oblivious.io/
Post by s***@gmail.com
https://www.npmjs.com/package/soap
soapResult = sync.await(client.authenticate( methodArgs, sync.defer()));
but soapResult is null
However, when i take a look at client.lastResponse i can see the xml
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>123456789</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<authenticateResponse xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>
I'm wondering if soapResult is null because authenticateResponse is null,
and it expects the value to be there? The value is in fact returned in the
header, i want to return BinarySecurityToken but i'm not sure how.
thanks
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/a8e4aab4-ef46-4837-833f-3a7ed1b55b69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2018-04-19 13:45:10 UTC
Permalink
Hi Mikkel, the authenticate method doesn't belong to the soap library, it
belongs to the 3rd party application. The 3rd party application has 5
methods in total, authenticate is the only method that returns the result
in the head, rather than the body.

I don't need to use client.setSecurity(), as there is no security on the
webservice. security is obtained via the autheticate web service token.

thanks
Post by Mikkel Wilson
client.authenticate doesn't appear to be a method in this library. It may
be making some kind of request that's populating lastRequest, but I think
https://github.com/vpulim/node-soap#basicauthsecurity
I'd also suggest skip the `sync.await` library. I'm not sure what it's
doing but it may be why lastResult is populated but the response doesn't
come back as you'd expect. Try it first the normal async way, then
promisify it later when you're sure it works.
HTH,
Mikkel
https://www.oblivious.io/
Post by s***@gmail.com
https://www.npmjs.com/package/soap
soapResult = sync.await(client.authenticate( methodArgs, sync.defer()));
but soapResult is null
However, when i take a look at client.lastResponse i can see the xml
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>123456789
</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<authenticateResponse xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>
I'm wondering if soapResult is null because authenticateResponse is null,
and it expects the value to be there? The value is in fact returned in the
header, i want to return BinarySecurityToken but i'm not sure how.
thanks
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/d86a77d8-58ad-4fa0-9cd6-26e5abb3463c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
善黃
2018-04-21 08:56:40 UTC
Permalink
ㄍ絊我䞀個犮拜的時間我會做曎完敎的敎理
ㄧ因為就是有甚CSS扟到封鎖我的網頁資料~所以才特別請求歀性鑑
嗚我䜿甚肥皂客戶端node.js圚這裡扟到https <https://www.npmjs.com/package/soap> : //www.npmjs.com/package/
<https://www.npmjs.com/package/soap>肥皂
<https://www.npmjs.com/package/soap>
我打電話絊我的方法
soapResult = sync.await(client.authenticate( methodArgs, sync.defer()));
䜆soapResult為null
䜆是當我看看client.lastResponse我可以看到我期望的xml響應
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>123456789</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<authenticateResponse xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>
我想知道soapResult是吊為null因為authenticateResponse為null䞊䞔它期望倌圚那裡
該倌寊際䞊圚頭郚返回我想返回BinarySecurityToken䜆我䞍知道劂䜕。
謝謝
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/55de3c2a-d85b-413d-800b-563127cf5843%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...