Node Soap - null response

309 views
Skip to first unread message

scottat...@gmail.com

unread,
Apr 9, 2018, 11:01:22 AM4/9/18
to nodejs
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




Mikkel Wilson

unread,
Apr 13, 2018, 9:17:35 PM4/13/18
to nodejs
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

scottat...@gmail.com

unread,
Apr 20, 2018, 9:53:08 AM4/20/18
to nodejs

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

善黃

unread,
Apr 21, 2018, 5:48:45 PM4/21/18
to nodejs
ㄍ給我一個禮拜的時間我會做更完整的整理
ㄧ因為就是有用CSS找到封鎖我的網頁資料~所以才特別請求此性鑑

scottat...@gmail.com於 2018年4月9日星期一 UTC+8下午11時01分22秒寫道:
嗨,我使用肥皂客戶端node.js在這裡找到:https//www.npmjs.com/package/ 肥皂

我打電話給我的方法:

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,但我不知道如何。

謝謝




Reply all
Reply to author
Forward
0 new messages