faultcode: soapenv:Server.userException faultstring: org.xml.sax.SAXException: operation description is missing parameter description
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://stuff.dom" xmlns:intf="http://stuff.dom" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://stuff.dom">
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://stuff.dom">
<element name="getSomeData">
<complexType>
<sequence>
<element name="searchString" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getSomeDataResponse">
<complexType>
<sequence>
<element name="getSomeDataReturn" type="impl:SomeData"/>
</sequence>
</complexType>
</element>
<complexType name="SomeData">
<sequence>
<element name="integer_value" type="xsd:int"/>
<element name="string_value" nillable="true" type="xsd:string"/>
<element name="date_value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getSomeDataRequest">
<wsdl:part element="impl:getSomeData" name="parameters"> </wsdl:part>
</wsdl:message>
<wsdl:message name="getSomeDataResponse">
<wsdl:part element="impl:getSomeDataResponse" name="parameters"> </wsdl:part>
</wsdl:message>
<wsdl:portType name="DataService">
<wsdl:operation name="getSomeData">
<wsdl:input message="impl:getSomeDataRequest" name="getSomeDataRequest"> </wsdl:input>
<wsdl:output message="impl:getSomeDataResponse" name="getSomeDataResponse"> </wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DataServiceSoapBinding" type="impl:DataService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getSomeData">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getSomeDataRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getSomeDataResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DataServiceService">
<wsdl:port binding="impl:DataServiceSoapBinding" name="DataService">
<wsdlsoap:address location="http://localhost:8080/DomSoap2/services/DataService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
When I called the web service via the API explorer or through a curl command, however, I got an
http error code 500 with the error message "faultcode: soapenv:Server.userException faultstring: org.xml.sax.SAXException: operation description is missing parameter description"
My web service was running on Tomcat and integrated in Eclipse. I used the TCP monitor view in Eclipse to see the actual xml request message.
It looked like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ns1:getSomeData xmlns:ns1="http://stuff.dom">
<__cachedRelations/>
<__data>
<searchString>aaa</searchString>
</__data>
<__dataSource/>
<__strict>false</__strict>
<__persisted>false</__persisted>
</ns1:getSomeData>
</soap:Body>
</soap:Envelope>
There are a bunch of __
elements in the message that shouldn't be there.
In one of the files generated by lb soap
, server/models/soap-data-service-soap-binding.js, there is a method that looks like this:
* getSomeData
* @param {getSomeData} getSomeData getSomeData
* @callback {Function} callback Callback function
* @returns {any} callback containing error or result. Result is the response/soap body in JSON form.
DataServiceServiceDataServiceSoapBinding.getSomeData = function(getSomeData, callback) {
_soapModel.getSomeData(getSomeData, function (err, response) {
var result = response;
callback(err, result);
The parameter getSomeData
is a loopback model object, and through the debugger, I can see that it has these __
methods. This is source of the problem in the xml message above.
If I change the code above to
* getSomeData
* @param {getSomeData} getSomeData getSomeData
* @callback {Function} callback Callback function
* @returns {any} callback containing error or result. Result is the response/soap body in JSON form.
DataServiceServiceDataServiceSoapBinding.getSomeData = function(getSomeData, callback) {
_soapModel.getSomeData(getSomeData.toJSON(), function (err, response) {
var result = response;
callback(err, result);
and I call the web service via the API Explorer
the xml request message looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ns1:getSomeData xmlns:ns1="http://stuff.dom">
<ns1:searchString>aaa</ns1:searchString>
</ns1:getSomeData>
</soap:Body>
</soap:Envelope>
I get an http 200 and a successful message from my web service:
"getSomeDataReturn": {
"integer_value": 1,
"string_value": "One",
"date_value": "2020-02-20T10:22:55.035222000-05:00"
After speaking with @raymondfeng , he mentioned that not all operation parameters may have the toJSON() method, so any fix to the generated code should take this into acccount.
Link to reproduction sandbox
Expected result
The generated code should call toJSON() on the operation parameter if this method is available.
This method is available on loopback model objects.
Additional information