Forum Discussion

FozzyBear18's avatar
FozzyBear18
New Contributor
7 years ago

MockService Deployed War (to Tomcat first request works, subsequent mockRequest.request get cut off

This seems to be an older issue/question that was never resolved.

 

Working soap UI 5.4 mock service, works fine in Soap UI (hit the play button) However once deployed to Tomcat, handles the first request fine, truncates the 2nd and any others following. Restarting the service allows the first to work again only. With logging statements in the soapui OnRequest script section, I confirmed mockRequest.requestContent is getting cut off. I've adjusted tomcat server.xml HTTP connector sizing settings, using -1 values to remove limits. :

 

<Connector port="8888" protocol="HTTP/1.1"
connectionTimeout="20000"
maxPostSize="-1"
maxSavePostSize="-1"
redirectPort="8443" />

 

I am out of ideas.

 

Here is a link to that older thread that brought me here.

 

https://community.smartbear.com/t5/SoapUI-Open-Source/Trouble-Logging-Request-Content/td-p/42805

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Are you using any Script Dispatcher in Mock Service? If so, would you mind showing the script used for review; otherwise it is difficult to comment or suggest any.
    • FozzyBear18's avatar
      FozzyBear18
      New Contributor

      Wow, a reply, thank you!  Script Dispatcher, I'd have to search on that. Below is my script from the OnRequestScript tab. It accepts a mock request, reads it, parses out a message ID and uses that to simply write a file to disk using messageId in the file name.  See anything? I uses log.info statements to see the the full request on attempt 1, but truncation on attempt 2, time and again.

       

      //Directory where the SOAP request XML is stored in the file system with messageId as the file name.

      def soapRequestFilePath = "D:/aisIntegrationTesting/inbound/";

      def requestObject = mockRequest.getRequestXmlObject().toString();

      //Parse the SOAP request XML file to get the messageID.
      def xmlRequest = new XmlSlurper().parseText(requestObject);
      def messageId = xmlRequest.Body.DocumentExchangeInput.exchangeEnvelope.@messageID;
      log.info ("messageId : $messageId");

      def fileName = new File("$soapRequestFilePath"+"$messageId"+".xml");
      fileName.write(requestObject);