Bad soap request, why?


Bad soap request, why?
Here is my request xml code:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">
<SOAP-ENV:Body xmlns:m = "http://example.org/quotations">
<m:GetQuotation>
<m:QuotationsName>MiscroSoft</m:QuotationsName>
</m:GetQuotation>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I copied this from w3c school.
When I send this request using a tool(boomerang like postman) to my local server, I got the following error message:
TypeError: Cannot read property 'description' of undefined
at SAXParser.p.onopentag (C:Usersnickprojectstest-soapnode_modulessoaplibwsdl.js:1305:27)
at emit (C:Usersnickprojectstest-soapnode_modulessaxlibsax.js:624:35)
at emitNode (C:Usersnickprojectstest-soapnode_modulessaxlibsax.js:629:5)
at openTag (C:Usersnickprojectstest-soapnode_modulessaxlibsax.js:825:5)
at SAXParser.write (C:Usersnickprojectstest-soapnode_modulessaxlibsax.js:1278:15)
at WSDL.xmlToObject (C:Usersnickprojectstest-soapnode_modulessoaplibwsdl.js:1507:5)
at Server._process (C:Usersnickprojectstest-soapnode_modulessoaplibserver.js:234:21)
at Server._processRequestXml (C:Usersnickprojectstest-soapnode_modulessoaplibserver.js:146:10)
at Server._requestListener (C:Usersnickprojectstest-soapnode_modulessoaplibserver.js:207:19)
at C:Usersnickprojectstest-soapnode_modulessoaplibserver.js:56:14
at Layer.handle [as handle_request] (C:Usersnickprojectstest-soapnode_modulesexpresslibrouterlayer.js:95:5)
at next (C:Usersnickprojectstest-soapnode_modulesexpresslibrouterroute.js:137:13)
at Route.dispatch (C:Usersnickprojectstest-soapnode_modulesexpresslibrouterroute.js:112:3)
at Layer.handle [as handle_request] (C:Usersnickprojectstest-soapnode_modulesexpresslibrouterlayer.js:95:5)
at C:Usersnickprojectstest-soapnode_modulesexpresslibrouterindex.js:281:22
at Function.process_params (C:Usersnickprojectstest-soapnode_modulesexpresslibrouterindex.js:335:12)
My question is what is going on? I have no idea what is going on.
Here is my wsdl file:
<wsdl:definitions targetNamespace="http://developer.intuit.com/">
<wsdl:documentation>
WebService for QBFS created using ASP.NET to troubleshoot QuickBooks WebConnector
</wsdl:documentation>
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://developer.intuit.com/">
<s:element name="serverVersion">
<s:complexType/>
</s:element>
<s:element name="serverVersionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="serverVersionResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="nickAgeSoapIn">
<wsdl:part name="parameters" element="tns:serverVersion"/>
</wsdl:message>
<wsdl:message name="nickAgeSoapOut">
<wsdl:part name="parameters" element="tns:serverVersionResponse"/>
</wsdl:message>
<wsdl:portType name="TestNickPort">
<wsdl:operation name="nickAge">
<wsdl:input message="tns:nickAgeSoapIn"/>
<wsdl:output message="tns:nickAgeSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestNickAgeWebServiceFSSoap" type="tns:TestNickPort">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="nickAge">
<soap:operation soapAction="http://developer.intuit.com/serverVersion" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="tns:TestNickPort">
<wsdl:port name="TroubleshootWebServiceFSSoap" binding="tns:TestNickPort">
<soap:address location="localhost:8001/wsdl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Here is my server code:
var soap = require('soap')
var http = require('http')
let url = 'https://test.developer.intuit.com/QBWC/TroubleshootWebServiceFS/Service.asmx?wsdl'
var express = require('express')
var bodyParser = require('body-parser')
var logger = require('morgan')
var myService =
MyService:
MyPort:
MyFunction: function(args)
return
name: args.name
;
,
// This is how to define an asynchronous function.
MyAsyncFunction: function(args, callback)
// do some work
callback(
name: args.name
);
,
// This is how to receive incoming headers
HeadersAwareFunction: function(args, cb, headers)
return
name: headers.Token
;
,
// You can also inspect the original `req`
reallyDetailedFunction: function(args, cb, headers, req)
console.log('SOAP `reallyDetailedFunction` request from ' + req.connection.remoteAddress);
return
name: headers.Token
;
;
var xml = require('fs').readFileSync('./test_minimum.wsdl', 'utf8')
var app = express();
app.use(logger('dev'));
app.get('', (req, res) => res.send('Hello world'))
//body parser middleware are supported (optional)
app.use(bodyParser.raw(type: function()return true;, limit: '5mb'));
app.listen(8001, function()
//Note: /wsdl route will be handled by soap module
//and all other routes & middleware will continue to work
soap.listen(app, '/wsdl', myService, xml);
console.log('express is listening port 8001...')
);
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment