26 September 2007 - 1.7.6 | home user-guide eclipse jbossws intellij netbeans maven 1.X/2.X PDF files forums bugs sourceforge

Home
Getting Started
User Guide

- Overview
  - Tabbed Desktop
  - License Management
  - Preferences
  - XPath Selection
  - Script Library
- Workspaces
- Projects
- Interfaces
  - Interface Viewer
- Operations
- Working with Requests
  - Form Editor
  - Overview View
  - Outline Editor
  - Message Inspectors
  - Attachments/Inline Files
- Functional Testing
  - Getting Started
  - TestSuites
  - TestCases
    - Test Requests
      - Assertions
      - Editor Wizards
    - Property Transfers
    - Conditional Gotos
    - Groovy Scripts
      - Examples
      - GroovyUtils
    - Properties Step
    - Delay Step
    - Mock Response
    - DataSource
    - DataSource Loop
  - Property Expansion
- Load Testing
  - Getting Started
  - Limit & Strategies
  - Execution
  - Assertions
  - Diagrams
  - JMeter comparison
- Mocking
  - Getting Started
  - Mock Services
  - Mock Operations
  - Mock Responses
- Usage Scenarios
  - Data-Driven Testing
  - Template-Driven Testing
  - Interactive Testing
  - Surveillance Testing
- Tool Integrations
  - Code Generation
  - WSDL Generation
  - WS-I Tools
  - Apache Tcp-Mon
- CommandLine Tools
  - TestCaseRunner
  - LoadTestRunner
  - MockServiceRunner
  - ToolRunner
- Keyboard shortcuts

IDE/Tool Plugins
Search soapUI site
Project Documentation

- About soapUI
- Project Info
- Project Reports

## SoapUIMockServiceRunner

The runner is defined in the `com.eviware.soapui.tools.SoapUIMockServiceRunner` class and takes the path to the soapUI project file containing the MockService and a number of options:

switch | description
--- | ---
m | The name of the MockService to run
p | The local port to listen on, overrides the port configured for the MockService
a | The local path to listen on, overrides the path configured for the MockService
s | The soapui-settings.xml file to use

The distribution contains a mockservicerunner.bat script for running mockservices in the bin directory, for example;

    mockservicerunner.bat -m"IOrderService MockService" "C:\Documents and Settings\Ole Matzura\My Documents\demo2-soapui-project.xml"

will start the specified MockService as follows:

    SoapUI SNAPSHOT MockService Runner
    15:08:15,515 INFO  [SoapUI] Added [file:/C:/workspace/core/ext/mysql-connector-java-5.0.4-bin.jar] to classpath
    15:08:16,375 INFO  [SoapUI] initialized soapui-settings from [soapui-settings.xml]
    15:08:16,406 INFO  [WsdlProject] Loaded project from [C:\Documents and Settings\Ole Matzura\My Documents\demo2-soapui-project.xml]
    15:08:17,609 INFO  [SoapUIMockServiceRunner] Running MockService [IOrderService MockService] in project [demo]
    15:08:17,609 INFO  [SoapUIMockServiceRunner] Press any key to terminate
    15:08:17,953 INFO  [MockEngine] Started mockService [IOrderService MockService] on port [8081] at path [/mockIOrderService]
    15:08:17,953 INFO  [SoapUIMockServiceRunner] MockService started on port 8081 at path [/mockIOrderService]
    Progress: 1 - Loading definition from cache
    15:09:18,625 DEBUG [WsdlContext] Loading definition from cache
    15:09:18,640 DEBUG [WsdlLoader] Returning baseInputSource [http://evitop:8080/OrderServiceImpl?wsdl]
    15:09:18,687 DEBUG [WsdlLoader] Returning baseURI [http://evitop:8080/OrderServiceImpl?wsdl]
    Retrieving document at 'http://evitop:8080/OrderServiceImpl?wsdl'.
    15:09:18,796 DEBUG [WsdlContext] Loaded definition: ok
    15:09:18,812 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/xop.xsd with targetNamespace http://www.w3.org/2004/08/xop/include
    15:09:18,890 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/XMLSchema.xsd with targetNamespace http://www.w3.org/2001/XMLSchema
    15:09:18,890 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/xml.xsd with targetNamespace http://www.w3.org/XML/1998/namespace
    15:09:18,890 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/swaref.xsd with targetNamespace http://ws-i.org/profiles/basic/1.1/xsd
    15:09:18,890 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/xmime200505.xsd with targetNamespace http://www.w3.org/2005/05/xmlmime
    15:09:18,890 INFO  [SchemaUtils] Added default schema from /C:/workspace/core/target/classes/xmime200411.xsd with targetNamespace http://www.w3.org/2004/11/xmlmime
    15:09:18,890 WARN  [SchemaUtils] Failed to open schemaDirectory [C:\workspace\soapui-pro\schemas]
    15:09:18,890 INFO  [SchemaUtils] Loading schema types from [http://evitop:8080/OrderServiceImpl?wsdl]
    15:09:18,890 INFO  [SchemaUtils] Getting schema http://evitop:8080/OrderServiceImpl?wsdl
    15:09:18,906 INFO  [SchemaUtils] schema for [http://www.example.org/OrderService/] contained [{}] namespaces
    15:09:19,359 INFO  [SoapUIMockServiceRunner] Handled request 1; [purchase] with [MockResponse 1] in [9ms] at [2007-04-03 15:09:17.968]
    15:09:20,734 INFO  [SoapUIMockServiceRunner] Handled request 2; [purchase] with [MockResponse 2] in [0ms] at [2007-04-03 15:09:20.734]
    15:09:21,296 INFO  [SoapUIMockServiceRunner] Handled request 3; [purchase] with [MockResponse 1] in [0ms] at [2007-04-03 15:09:21.296]
    15:09:21,937 INFO  [SoapUIMockServiceRunner] Handled request 4; [purchase] with [MockResponse 2] in [0ms] at [2007-04-03 15:09:21.937]
    15:09:22,343 INFO  [SoapUIMockServiceRunner] Handled request 5; [purchase] with [MockResponse 1] in [0ms] at [2007-04-03 15:09:22.343]

Which can now be invoked from soapUI or any other client. Terminate the runner by pressing the return key in the console, which will shutdown as follows:

    15:20:30,703 INFO  [MockEngine] Stopping connector on port 8081
    15:20:30,703 INFO  [MockEngine] No more connectors.. stopping server
    15:20:30,703 INFO  [SoapUIMockServiceRunner] MockService stopped, handled 7 requests
    15:20:30,703 INFO  [SoapUIMockServiceRunner] time taken: 733117ms

Next: SoapUIToolRunner