Node-Soap无法读取未定义的属性“Body”

时间:2015-01-24 17:37:14

标签: node.js web-services soap node-soap

使用node-soap:

我尝试使用此服务:http://services.resumeparsing.com/ParsingService.asmx?op=ParseResume

我在查询GetAccountInfo时收到成功的回复,因此我知道我的帐户/服务密钥是正确的:http://services.resumeparsing.com/ParsingService.asmx?op=GetAccountInfo

当我尝试使用ParseResume服务时,我看到的错误是:TypeError: Cannot read property 'Body' of undefined

以下是我如何调用ParseResume:

var buff_string = new Buffer(upload, 'base64')
var soap_args = {
   url:"http://services.resumeparsing.com/ParsingService.asmx?wsdl",
   args: {
      request: {
         AccountId    : myAccountId,
         ServiceKey   : myServiceKey,
         FileBytes    : buff_string,
         OutputXmlDoc : true,
         Configuration: myConfString
       }
   }
}

client.ParsingService.ParsingServiceSoap12.ParseResume(soap_args.args, function(err, result){
    if(err) console.log ( err )
    if(result) console.log (result)
})

正如您可能已经说过的那样,我之前从未使用过SOAP,我们非常感谢任何指导!

编辑:FileBytes要求base64Binary字符串

1 个答案:

答案 0 :(得分:1)

改变

var buff_string = new Buffer(upload, 'base64')

var buff_string = (new Buffer(upload)).toString('base64')