0

I am trying utilize the npm strong-soap package to execute a SOAP call in nodejs.

I am getting an error as below (first few lines of error is below)

"statusCode":500,"body":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:
Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n    <SOA
P-ENV:Body>\n        <SOAP-ENV:Fault>\n            <faultcode>BWENGINE-100031</f
aultcode>\n            <faultstring>Output data invalid</faultstring>\n
   <faultactor>JOBID_15734</faultactor>\n            <detail>\n                <
ns0:Error_Short_Message xmlns:ns0=\"http://xmlns.example.com/unique/default/name
space/1073503881527\">\n                    <ns0:key>JOBID_15734</ns0:key>\n
                <ns0:msg_code>BWENGINE-100031</ns0:msg_code>\n
  <ns0:message>Output data invalid</ns0:message>\n 

The client code is as below:

var soap = require('strong-soap').soap;
 var url = 'D:/Workspace/Projects/Sample.wsdl';
  var args = {arg1: '6564',arg2:'ONE'};
    var soapHeader = {
        'header1': 'value1',
        'header2': 'value2',
        'header3': 'value3',
    };
var options = {};
  soap.createClient(url,options,function (err, client) {
      client.setEndpoint('http://hostname:Port/SampleService/Service');
      var method = client['GetDataMethod'];
      method(args,function (err, result, envelope, soapHeader) {
          //response envelope
          //console.log('Response Envelope: \n' + envelope);
          //'result' is the response body
          console.log('Result: \n' + JSON.stringify(result));
      })
  });

Any suggestions on the reason for this error would be helpful.

UPDATE:

I was able to fire the request and get response if I build the args as something like below:

var args = {
   "namespace":{
        "requestHeader":{
            "header1": "value1",
            "header2": "value2",
            "header3": "value3"
            },
        "arg1": "6564",
        "arg2":"ONE"}
   };

But any reason why strong-soap is unable to setup the namespace based on wsdl content? Programmatically identifying the exact namespace among 20-30 namespaces in wsdl seems to be cumbersome task.

GCTian
  • 1
  • 3
  • Check the parameters that you send to the server, it's probably one of the header or param that causes an exception in your server side code, i.e your WSDL file and hence you get a 500 response code (hich stands for Server error). – Geet Choubey Mar 28 '18 at 09:36
  • I have tested the same SOAP WSDL in SOAP UI and I got the proper response.Just using 'strong-soap' package to do it via nodejs is creating problems. Any idea on how to get this sorted out. – GCTian Mar 29 '18 at 03:43
  • edited the question with latest update – GCTian Mar 30 '18 at 05:36

0 Answers0