发送soap请求后收到错误它返回statusCode 401为什么?

时间:2016-05-04 12:14:10

标签: node.js

1.为什么让StatusCode 401响应?

2.in request(varbody变量)发送orderID。

3.inin返回所有细节对应oderID

4.但是它给出了StatusCode 401的响应

     bodyVar="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP-ENV:Header/><SOAP-ENV:Body><ipgapi:IPGApiActionRequest xmlns:ipgapi=\"http://ipg-online.com/ipgapi/schemas/ipgapi\" xmlns:v1=\"http://ipg-online.com/ipgapi/schemas/a1\"><v1:Action><v1:InquiryOrder><v1:OrderId>0504_0002</v1:OrderId></v1:InquiryOrder></v1:Action></ipgapi:IPGApiActionRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>";

var options = {
        uri: url,            
        agentOptions: {
            cert: certFileContents,
            key: keyFileContents,
            passphrase: 'abc',

        },
        rejectUnauthorized : false,
        headers:{
             'Content-Type': ' text/xml'
        },
        body: bodyVar       
    };

    request.post(options,function(err,res,body){
    console.log(res.StatusCode);//here im getting 401 why?
   }).auth(Uid,Pass,true)

0 个答案:

没有答案