Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
15 years ago

Deploy as War questions

Hello,
I have some mock services which I would like to deploy on my apache tomcat instance. I think I can use the 'deploy as war' feature of soapUI.
The help section for this feature seems outdated.

Would it be possible to list the steps needed to deploy my mock services on apache tomcat. I am using windows and my tomcat instance is on
C:\Program Files\Apache Software Foundation\Tomcat 6.0

I am not sure whats the purpose and how to use these fields in the war dialog box
* WebUI
* MockService Endpoint
* War File
* War directory

Thanks for you help

Ali

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    *WebUI - if checked you will be able to see mock service log.
    *MockService Endpoint - end point to your mock service
    *War file - war archive which could be used for deploy
    *War directory - directory where WEB-INF directory will be created, could be used for deploy...

    I'm not sure is this helpful so I'll give you example:
    I have a project called ValidateEmail. It have two mock services : "Test" and "ValidateEmailSoap MockService".
    For mock service "Test" endpoint is set to "/test" ( check mock editor -> options ).
    For mock service "ValidateEmailSoap MockService" is set to "/mockValidateEmailSoap".
    This far should be familiar stuff..

    Now, let go to project pop-up and choose Mock As War.
    Enable WebUI, set endpoint to "vem". I'll put war file to "/home/robert/Documents/mockAsWar/mock.war" and
    war directory : "/home/robert/Documents/mockAsWar/". To be clear here, you do not need to specify war directory
    and war file could be put anywhere. I did this way since I like this way. Maybe it is confusing..
    Now, click "Ok" and wait for soapUI to generate war file. You should have WEB-INF folder in war directory which is
    contest of war file.

    Deploying..Assuming you have already set up and running tomcat. Go to tomcat manager. At the bottom of page you should
    have "Deploy" section. Under it in "WAR file to deploy set path to your created war file ( in my case is
    "/home/robert/Documents/mockAsWar/mock.war" ). And click "Deploy".
    Now you should see deployed war file ( as "/mock" ) under "Applications".
    If you go to : "http://localhost:8080/mock/vem" you should see log page with link to wsdls ( one wsdl for each mock service you
    created in project, remember I said I have two in my project ).
    I can access to my mock services ( send requests ) with :
    "http://localhost:8080/mock/test" -> for mock service "Test"
    "http://localhost:8080/mock/mockValidateEmailSoap" -> for mock service "ValidateEmailSoap MockService"

    As you can see "Mock As War" wraps all your mock services in one project. So, you are able to deployed them on your server.
    In log you'll see every request sent to mock services with request, response and groovy script log ( since groovy could be
    used for dispatching responses).

    This should help you to go on with this feature. I hope I was not confusing. I hope you'll like this feature...
    Let me know does it helps,

    robert.



     
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi,

    I use version: soapUI Pro 3.6.1

    Regarding the problem above I have a question, too.
    When following the instructions everything works as described. But when trying to access the http://localhost:8080/mock/vem I just get an empty page, splitted in 3 areas (see screenshot below):



    Do you know this problem?

    Best regards
    Nico
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Can you post how did you configured war ( creation dialog screenshot will be fine ). I need to know how did you created to reproduce it. It looks like debug window which is added if you check it in mock as war dialog.

    robert
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Robert,

    thanks for answering.
    See my screenshot below.
    I tried to follow the instructions as much as possible (just saved the files to a folder on the desktop).


    regards
    Nico
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    This should be fixed by now. Fix is available in nightly-builds. Let us know do you still have problems with this.

    robert
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi Robert,

    I now was able to check the problem using the nightbuild of Nov-08.
    Now I can access the MockService log at http://localhost:8080/myMock/vem.

    But there are some things I do not understand.
    1) As written before, I set "vem" as endpoint, when exporting the mock service.
    But I cannot access the mock in http://localhost:8080/myMock/vem.
    Instead I checked the WSDL-URL, which is http://localhost:8080/myMock/mockDienst ... nding?WSDL.
    Using this URL (cut ?WSDL before) I can access the Mock.
    So is this URL created from? I cannot remember a path like this to be defined.

    2) My mock operation consists of 2 mock responses. The 1st response is the default one. Dispath = Script (but no script is defined).
    When sending a request to this service, only the 2nd mock-response will be send back.

    Could you please explain this to me?

    Best regards
    Nico