Forum Discussion

shashankalst's avatar
New Contributor
6 years ago

Soap UI Mock service for Rest not working when deployed as war

I want to create SoapUI mock service for the endpoint: "/product/123456/details/". Here 123456 is path variable. I have created a soap ui mock service with path as "/product/" and in response I'm just giving back the path(Just for testing). When I run this mock service in SoapUI on port 8210, and hitting "http://localhost:8210/product/123456/details" works perfect. I get the below response.

But when I deploy this as mymockwar war in tomcat running on port 8080, If I hit "http://localhost:8080/mymockwar/product/123456/details/", Then I get the response as below.

        <title>soapUI MockServices Log for project [MyNewMock]</title>
        <h3>Log is disabled.</h3>

Now if I hit "http://localhost:8080/mymockwar/product/" it works and gives me the response as


How can I make this working with path variable when deployed in tomcat? Tomcat version: 7.0.22 SoapUI version: 4.5.2

Mock service xml below.

<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project xmlns:con="" activeEnvironment="Default" name="MyNewMock" resourceRoot="" soapui-version="4.5.2" abortOnError="false" runType="SEQUENTIAL">
   <con:settings />
   <con:mockService port="8210" path="/product/" host="localhost" name="testSoapMock" bindToHostOnly="false" docroot="">
         <con:setting id="com.eviware.soapui.impl.wsdl.mock.WsdlMockService@require-soap-action">false</con:setting>
      <con:properties />
      <con:onRequestScript>def method = mockRequest.method;
def path = mockRequest.path; path
def response = mockRequest.getHttpResponse()
            def writer = response.getWriter();
   <con:properties />
   <con:wssContainer />
No RepliesBe the first to reply