Forum Discussion

Anish's avatar
Anish
Occasional Contributor
12 years ago

Externalizing Response XML for Mock Service WAR

Hi,

I have a REST Mock service in which i return a xml (stored in local disk) file as response for a particular request to the mock service. But when i deploy this project as a war and access the localhost to send the reqest, i get a html response
<html>
<head>
<title>soapUI MockServices Log for project [HandCraftedEnstratiusSSL]</title>
</head>
<frameset rows="40%,40%,*">
<frame src="master"/>
<frame name="detail" src="detail"/>
<frame src="log"/>
</frameset>
</html>

The response xml is not added to the war during war creation. Am using groovy script in which the return file path is mentioned. How can i render the xml file as response to the request when trying from local host?

Regards,
Anish

2 Replies

  • cortez's avatar
    cortez
    Occasional Contributor
    Anish wrote:
    Hi,

    I have a REST Mock service in which i return a xml (stored in local disk) file as response for a particular request to the mock service. But when i deploy this project as a war and access the localhost to send the reqest, i get a html response
    <html>
    <head>
    <title>soapUI MockServices Log for project [HandCraftedEnstratiusSSL]</title>
    </head>
    <frameset rows="40%,40%,*">
    <frame src="master"/>
    <frame name="detail" src="detail"/>
    <frame src="log"/>
    </frameset>
    </html>


    This looks very similar to a problem I am having. See this thread.

    What are your 'Deploy As War' settings?
  • Anish's avatar
    Anish
    Occasional Contributor
    Yes, i too get the browser window with horizontal panes. I have given only one word in the MockServiceEndpoint, like "testservice". The Mock service is not able to pick up the path of the request which i have given in the groovy script. In my groovy script, i have like when the Mockrequest is GET and when mock request path is "something/something" , it should return a xml file. It is working fine in soapui. But after deploying as war,the script doesnt read the path.

    Regards,
    Anish