mike12345
16 years agoNew Contributor
mock request with null-parameter operation
Hi, I am using 2.5.1 and am trying to run a mock service based on the WSDL generated for a POJO Service originally written in Axis2 that has a simple, no-argument ping operation. eg, the service method looks something like
without including the entire WSDL, snippets of the messages and portType sections look like
Note the pingRequest is empty. If I use soapUI to generate a default request from schema it produces:
But when I issue such a request the mock service throws a dispatch exception as follows:
specifically
I tried using a Groovy script to verify the contents of the mockRequest and mockRequest.getContentElement() returns null, which seems expected, though there seems to be code in other areas of the processing where that will cause this or a similar exception.
I also tried using a pre-dispatch script to try to play with the contents, which causes the content element to be non-null, but then of course it cant be dispatched because there is no operation defined in the wsdl with a non-null input for ping.
Does soapUI not allow empty envelope bodies in the mock service? If not, how is a no-parameter operation invoked? This kind of soap request is handled fine in other deployment environments.
thanks in advance for any guidance,
mike
public MyResponse ping() { ... }
without including the entire WSDL, snippets of the messages and portType sections look like
<wsdl:message name="pingRequest" />
<wsdl:message name="pingResponse">
<wsdl:part name="parameters" element="ns:pingResponse" />
</wsdl:message>
...
<wsdl:operation name="ping">
<wsdl:input message="axis2:pingRequest" wsaw:Action="urn:ping" />
<wsdl:output message="axis2:pingResponse" wsaw:Action="urn:pingResponse" />
</wsdl:operation>
Note the pingRequest is empty. If I use soapUI to generate a default request from schema it produces:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
But when I issue such a request the mock service throws a dispatch exception as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing content element in body</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
specifically
Thu Apr 02 14:52:18 PDT 2009:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing content element in body
com.eviware.soapui.impl.wsdl.mock.DispatchException: com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing content element in body
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:387)
at com.eviware.soapui.monitor.MockEngine$ServerHandler.handle(MockEngine.java:596)
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:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:828)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
Caused by: com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing content element in body
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.findOperationForRequest(SoapUtils.java:202)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:255)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:377)
... 11 more
I tried using a Groovy script to verify the contents of the mockRequest and mockRequest.getContentElement() returns null, which seems expected, though there seems to be code in other areas of the processing where that will cause this or a similar exception.
I also tried using a pre-dispatch script to try to play with the contents, which causes the content element to be non-null, but then of course it cant be dispatched because there is no operation defined in the wsdl with a non-null input for ping.
Does soapUI not allow empty envelope bodies in the mock service? If not, how is a no-parameter operation invoked? This kind of soap request is handled fine in other deployment environments.
thanks in advance for any guidance,
mike