Forum Discussion

schnizlein's avatar
schnizlein
Contributor
15 years ago

Re: Having trouble with MockResponse Test Step

I have a MockService that we've been using for some time to test WebService requests coming from our system.

I'm now trying to automate the process, and have created a Test Case that will trigger the request.

The problem is: This is a 2 call-process, after the response for Operation 1 is returned, a 2nd call should be sent. 
However, After the first MockResponse test step executes properly, our system is blowing up with a "Internal Server Error [500]".  SoapUI never gets the 2nd call.  I have both MockResponse steps set up to 'Start Listening' on the same step

What am I doing different from a 'normal' Mockservice answering both calls, vs 2 MockResponse test steps?

The normal timing difference between the 2:
2010-04-14 12:09:36.130: [AddLocation] 1ms
2010-04-14 12:09:36.162: [ReplaceLocation] 1ms

I can attach the project or Stack Trace if that would be helpful.

5 Replies

  • After chatting with the Developer, we think what is happening is both Calls are going to the first (AddLocation) MockService instance.   
    If the 2nd MockResponse is disabled, then I get this error:
    Thu Apr 15 11:11:58 CDT 2010:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [] and body element [{urn:com:ssn:schema:service:v1.0:DeviceManager.xsd}ReplaceLocation] with SOAP Version [SOAP 1.1]
      com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [] and body element [{urn:com:ssn:schema:service:v1.0:DeviceManager.xsd}ReplaceLocation] with SOAP Version [SOAP 1.1]
      at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.findOperationForRequest(SoapUtils.java:353)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:260)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:383)
      at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:701)
      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:938)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      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:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

    If the 2nd MockResponse is ENABLED, I get this error (I also get the above error as a debug statement):
    Thu Apr 15 11:18:07 CDT 2010:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null
      com.eviware.soapui.impl.wsdl.mock.DispatchException: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:396)
      at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:701)
      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:938)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      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:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      Caused by: org.apache.xmlbeans.XmlException: error: Unexpected end of file after null
      at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
      at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:712)
      at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:696)
      at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:683)
      at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208)
      at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:580)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.getRequestXmlObject(WsdlMockRequest.java:270)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.initPostRequest(WsdlMockRequest.java:147)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.(WsdlMockRequest.java:102)
      at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:376)
      ... 11 more
      Caused by: org.xml.sax.SAXParseException: Unexpected end of file after null
      at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
      at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
      at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3454)
      ... 20 more


    Both situations cause the 500 error in our application.  We actually got it to work once, but 99% of the time it fails.
  • Any ideas on this one?

    Would it be possible to contain more than one operation in a single MockResponse test step?
  • Hate to do a bump, but this is blocking automation of a major functional area for us.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    hmm.. have you tried setting the start-step of the second mockresponse step to the first one?

    regards,

    /ole
    eviware.com
  • Yup.  It appears that the 2nd request is so fast it connects to the wrong instance.

    I also tried having them both start at an earlier test step (one that triggers the requests).