Forum Discussion

erki's avatar
erki
Occasional Contributor
11 years ago

[R]Missing operation for soapAction [] and body element, moc

Hi,

I am receiving DispatchException on my mockservice when requesting responses from mock thru web client. In mock logs i see:

com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [] and body element [{xxxx.xxxx/producer}list_documents] with SOAP Version [SOAP 1.1]
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.findOperationForRequest(SoapUtils.java:359)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:250)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:375)
at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:715)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

If i query the same thing thru soapUI everything works. On my mock properties, the "Require SOAP Action" is set to false.

It doesn't happen with all of the WSDLs, but only some of them. What could be the problem?

7 Replies

  • erki's avatar
    erki
    Occasional Contributor
    No replys needed here. Figured it out.
  • Hi,

    Thanks for resolving your issue. It would be good for the community if you post your resolution to the problem here.




    Thanks.
  • fyerf's avatar
    fyerf
    New Contributor
    erki wrote:
    No replys needed here. Figured it out.

    fyerf wrote:
    Having the same issue especially with soap1.2 WSDLs. Would greatly appreciate insight into how you resolved same.
  • fyerf's avatar
    fyerf
    New Contributor
    Greetings, I am having the same issue especially with soap1.2 WSDLs. Any insight into resolution would be most appreciated. The returned mock fault message follows:

    <soap:Text xml:lang="en">Missing operation for soapAction [http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0/HelloWorldServicePortType/HelloWorldRequest] and body element [{http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0}HelloWorldRequest] with SOAP Version [SOAP 1.2]</soap:Text>
  • fyerf's avatar
    fyerf
    New Contributor
    Greetings all,

    As it turns out, for multipart WSDLs, soapUI needs the body part declared and bound first for it to build a mock service correctly. Below is a Hello Word example of of a multiple part explicit bindings WSDL with the message body parts declared and bound first. It is consumed by soapUI and generates a mock service without errors. Changing the order of part declaration/binding causes the mock service to throw spurious Missing operation for soapAction faults. I have tested this approach successfully for both SOAP1.1 and 1.2 WSDLs.

    Best regards,

    fyerf

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ca-hlw="http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" name="HelloWorldService" targetNamespace="http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0">
    <wsdl:types>
    <xsd:schema>
    <xsd:import namespace="http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0" schemaLocation="HelloWorldService.xsd"/>
    <xsd:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="ws_addr.xsd"/>
    <xsd:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" schemaLocation="oasis_200401_wss_wssecurity_secext_1.0.xsd"/>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="HelloWorldRequestMessage">
    <wsdl:part name="body" element="ca-hlw:HelloWorldRequest"/>
    <wsdl:part name="MessageID" element="wsa:MessageID"/>
    <wsdl:part name="From" element="wsa:From"/>
    <wsdl:part name="Action" element="wsa:Action"/>
    <wsdl:part name="Security" element="wsse:Security"/>
    </wsdl:message>
    <wsdl:message name="HelloWorldResponseMessage">
    <wsdl:part name="body" element="ca-hlw:HelloWorldResponse"/>
    <wsdl:part name="MessageID" element="wsa:MessageID"/>
    <wsdl:part name="Action" element="wsa:Action"/>
    </wsdl:message>
    <wsdl:message name="HelloWorldFaultListMessage">
    <wsdl:part name="HelloWorldFaultList" element="ca-hlw:HelloWorldFaultList"/>
    </wsdl:message>
    <wsdl:portType name="HelloWorldServicePortType">
    <wsdl:operation name="HelloWorld">
    <wsdl:input name="HelloWorldRequest" message="ca-hlw:HelloWorldRequestMessage"/>
    <wsdl:output name="HelloWorldResponse" message="ca-hlw:HelloWorldResponseMessage"/>
    <wsdl:fault name="HelloWorldFaultList" message="ca-hlw:HelloWorldFaultListMessage"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="HelloWorldServicePortTypeBinding" type="ca-hlw:HelloWorldServicePortType">
    <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="HelloWorld">
    <soap12:operation soapAction="http://ca.gov/niem/webservice/helloworldservice/ca-hlw/1.0/HelloWorld"/>
    <wsdl:input name="HelloWorldRequest">
    <soap12:body parts="body" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldRequestMessage" part="MessageID" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldRequestMessage" part="From" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldRequestMessage" part="Action" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldRequestMessage" part="Security" use="literal"/>
    </wsdl:input>
    <wsdl:output name="HelloWorldResponse">
    <soap12:body parts="body" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldResponseMessage" part="MessageID" use="literal"/>
    <soap12:header message="ca-hlw:HelloWorldResponseMessage" part="Action" use="literal"/>
    </wsdl:output>
    <wsdl:fault name="HelloWorldFaultList">
    <soap12:fault name="HelloWorldFaultList" use="literal"/>
    </wsdl:fault>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HelloWorldService">
    <wsdl:port name="HelloWorldServicePortType" binding="ca-hlw:HelloWorldServicePortTypeBinding">
    <soap12:address location="http://EndPoint/Goes/Here/"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    • mindgnat's avatar
      mindgnat
      Occasional Contributor

      Thanks for taking the time to post this solution. However, that had no effect on my Community Edition 5.2.1 version of SoapUI. 

       

      The same problem persists.

       

      Has anyone else tried this solution and gotten past the problem or does it still remain after this change?