Forum Discussion

coolsai's avatar
15 years ago

start multiple mock servers in same port with diifarent path using command promt

Hi Team,

My requirement is to start multiple mock services using command prompt. All the services run in same port but the path for each one is different.

I tried with 2 mock services in 2 command prompts some thing like
mockservicerunner "C:\Program Files\eviware\soapUI-2.5.1\BMLAccount-soapui-project.xml" in one command prompt and
mockservicerunner "C:\Program Files\eviware\soapUI-2.5.1\BMLSingleSignOn-soapui-project.xml" in another command prompt.
When i give a request to the first service i am able to get the expected response but when i try to send a request to the second one i am getting a response like

There are currently 1 running soapUI MockServices


If i start the 2 mock services in different ports then its working fine.

Can you tell me if i their is any solution for this. Any idea is well appreciated.
Thank you!
Sai

7 Replies

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

    You cannot do this when running separate command prompts, as only one application can bind to a single port at one time. If you put both MockServices in the same project it should be possible to run both services using a single mockservicerunner on one port, as long as the paths are different.

    Regards,
    Dain
    eviware support
  • I had the same problem, but as you have said they can't be run in separate command prompts.

    What would be the syntax for the command line to run multiple MockServices in the same project with a single mockservicerunner on one port?

    I have tried the following:

    "C:\Program Files\SmartBear\soapUI-4.5.2\bin\mockservicerunner.bat" -m"Service1SoapBinding MockService" -m"Service2SoapBinding MockService" "C:\Path\my-soapui-project.xml"

    But this only seems to start the service in the first named parameter.
    This can be done from the UI, but we would like to automate the start-up of the services with a simple batch file.
  • I'm having the same issue - any feedback on how to do this?
  • Let's think that it's impossible and we need use the different ports.
  • chiel78's avatar
    chiel78
    New Contributor
    You can also run mockservicerunner.bat with only one argument, the soap-ui-project-name.xml
    It will then run all the Mockservices within that project by default.

    See code: http://massapi.com/source/soapui-4.0.0/ ... .java.html

    Tip:
    If your Mockservices are spread out over different projects, you can simply clone Mockservice from one project to another.
    To do this, open SoapUI application > right-click on MockService within a project > select clone.
    SoapUI will present you with option to clone to another existing project, just go with the other default options and voila you have one project with different MockServices.
  • chiel78's avatar
    chiel78
    New Contributor
    You can also run mockservicerunner.bat with only one argument, the soap-ui-project-name.xml
    It will then run all the Mockservices within that project by default.

    e.g.
    mockservicerunner.bat -p"8088" C:\development\soapuiMockservice\soapui-project-name-containing-multiple-mockservices.xml


    See code: http://massapi.com/source/soapui-4.0.0/ ... .java.html

    Tip:
    If your Mockservices are spread out over different projects, you can simply clone Mockservice from one project to another.
    To do this, open SoapUI application > right-click on MockService within a project > select clone.
    SoapUI will present you with option to clone to another existing project, just go with the other default options and voila you have one project with different MockServices.
  • chiel78's avatar
    chiel78
    New Contributor
    You can also run mockservicerunner.bat with only one argument, the soap-ui-project-name.xml
    It will then run all the Mockservices within that project by default.

    e.g.
    mockservicerunner.bat -p"8088" C:\development\soapuiMockservice\soapui-project-name-containing-multiple-mockservices.xml


    See code: http://massapi.com/source/soapui-4.0.0/ ... .java.html

    Tip:
    If your Mockservices are spread out over different projects, you can simply clone Mockservice from one project to another.
    To do this, open SoapUI application > right-click on MockService within a project > select clone.
    SoapUI will present you with option to clone to another existing project, just go with the other default options and voila you have one project with different MockServices.