<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="8f700cdf-56bd-4234-9f23-09b4f37e2ed8" activeEnvironment="Default" name="Cloning TestSuite examples" resourceRoot="" soapui-version="5.4.0" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface name="ServiceSoapBinding" bindingName="{http://www.soapui.org/sample/}ServiceSoapBinding" soapVersion="1_1" definition="WSDL-WADL/sample-service.wsdl" xsi:type="con:WsdlInterface" wsaVersion="NONE" id="2a8c0277-e347-4353-b442-14a3bd5bd5b6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:endpoints><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:endpoint>http://www.soapui.org/sample</con:endpoint></con:endpoints><con:operation action="http://www.soapui.org/sample/login" name="login" bindingOperationName="login" inputName="" isOneWay="false" receivesAttachments="false" sendsAttachments="false" type="Request-Response" id="1f505ff8-9d1c-4a86-b40a-09c3ace8fe38"><con:settings/><con:call name="login rq" outgoingWss="" incomingWss="" id="ac2e1ed5-1fd8-4ec6-9fa5-93dbc0587c3b"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<xml>
    <ac:infos>
        <ac:info xsi:type="ac:FieldInfo">
        <ac:infoKey>messageField2</ac:infoKey>
        <ac:label>Message Field 2</ac:label>
        <ac:labelStandAlone>Message Field 2</ac:labelStandAlone>
        <ac:displayOrder>2</ac:displayOrder>
        <ac:display>true</ac:display>
        <ac:dataType>string</ac:dataType>
        </ac:info>
        </ac:infos>
        </ac:info>
        <ac:info xsi:type="ac:FieldInfo">
        <ac:infoKey>referenceNumberText</ac:infoKey>
        <!--(ideally if there is a value there will be one more key as <ac:value>cbbbc</ac:value> after the ac:infokey refernce number text.I need to know if that tag is not available.-->
        <ac:label>Reference Number Text</ac:label>
        <ac:labelStandAlone>Reference Number Text</ac:labelStandAlone>
        <ac:displayOrder>118</ac:displayOrder>
        <ac:display>true</ac:display>
        <ac:dataType>string</ac:dataType>
        </ac:info>
    </ac:infos>
</xml>    ]]></con:request><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation action="http://www.soapui.org/sample/logout" name="logout" bindingOperationName="logout" inputName="" isOneWay="false" receivesAttachments="false" sendsAttachments="false" type="Request-Response" id="1af36640-6ce3-4a83-a7bb-951f47d6ac60"><con:settings/><con:call name="logout rq" outgoingWss="" incomingWss="" id="78844e25-cb55-4431-b494-f6169d6ee63c"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>21974891784000294</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation action="http://www.soapui.org/sample/search" name="search" bindingOperationName="search" inputName="" isOneWay="false" receivesAttachments="false" sendsAttachments="false" type="Request-Response" id="8e9ba9a8-66df-4f82-a106-58c1b71b70ac"><con:settings/><con:call name="search rq" outgoingWss="" incomingWss="" id="e5774b1e-89fd-4988-995d-96f770ba8256"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:search>
 <sessionid>0154144954954053</sessionid>
 <searchstring>?</searchstring>
 </sam:search>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation action="http://www.soapui.org/sample/buy" name="buy" bindingOperationName="buy" inputName="" isOneWay="false" receivesAttachments="false" sendsAttachments="false" type="Request-Response" id="6f7691c0-2570-4c8d-9346-b4b59a732bcf"><con:settings/><con:call name="buy rq" outgoingWss="" incomingWss="" id="eb85c8d3-5027-4530-b40e-401387751147"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buy>
 <sessionid>?</sessionid>
 <buystring>?</buystring>
 </sam:buy>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:definitionCache rootPart="WSDL-WADL/sample-service.wsdl"><con:part><con:url>WSDL-WADL/sample-service.wsdl</con:url><con:content><wsdl:definitions name="sample" targetNamespace="http://www.soapui.org/sample/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.soapui.org/sample/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
 <wsdl:types>
 <xsd:schema targetNamespace="http://www.soapui.org/sample/">
 <xsd:element name="searchResponseContent">
 <xsd:complexType>
 <xsd:sequence>
 <xsd:element name="item" type="tns:ItemType" maxOccurs="unbounded"/>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="ItemType">
 <xsd:sequence>
 <xsd:element name="id" type="xsd:string"/>
 <xsd:element name="description" type="xsd:string"/>
 <xsd:element name="price" type="xsd:string"/>
 </xsd:sequence>
 </xsd:complexType>
 <xsd:element name="buyResponseContent">
 <xsd:complexType>
 <xsd:sequence>
 <xsd:element name="purchasestatus" type="tns:PurchaseStatusType" maxOccurs="unbounded"/>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="PurchaseStatusType">
 <xsd:sequence>
 <xsd:element name="id" type="xsd:string"/>
 <xsd:element name="stockStatus" type="xsd:string"/>
 <xsd:element name="expectedDelivery" type="xsd:string"/>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:schema>
 </wsdl:types>
 <wsdl:message name="loginRequest">
 <wsdl:part name="username" type="xsd:string"/>
 <wsdl:part name="password" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="loginResponse">
 <wsdl:part name="sessionid" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="logoutResponse">
 <wsdl:part name="sessioninfo" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="logoutRequest">
 <wsdl:part name="sessionid" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="searchRequest">
 <wsdl:part name="sessionid" type="xsd:string"/>
 <wsdl:part name="searchstring" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="searchResponse">
 <wsdl:part name="searchresult" element="tns:searchResponseContent"/>
 </wsdl:message>
 <wsdl:message name="buyRequest">
 <wsdl:part name="sessionid" type="xsd:string"/>
 <wsdl:part name="buystring" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="buyResponse">
 <wsdl:part name="buyresult" element="tns:buyResponseContent"/>
 </wsdl:message>
 <wsdl:message name="login_faultMsg">
 <wsdl:part name="loginFault" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="logout_faultMsg">
 <wsdl:part name="logoutFault" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="search_faultMsg">
 <wsdl:part name="searchFault" type="xsd:string"/>
 </wsdl:message>
 <wsdl:message name="buy_faultMsg">
 <wsdl:part name="buyFault" type="xsd:string"/>
 </wsdl:message>
 <wsdl:portType name="ISampleService">
 <wsdl:operation name="login">
 <wsdl:input message="tns:loginRequest"/>
 <wsdl:output message="tns:loginResponse"/>
 <wsdl:fault name="fault" message="tns:login_faultMsg"/>
 </wsdl:operation>
 <wsdl:operation name="logout">
 <wsdl:input message="tns:logoutRequest"/>
 <wsdl:output message="tns:logoutResponse"/>
 <wsdl:fault name="fault" message="tns:logout_faultMsg"/>
 </wsdl:operation>
 <wsdl:operation name="search">
 <wsdl:input message="tns:searchRequest"/>
 <wsdl:output message="tns:searchResponse"/>
 <wsdl:fault name="fault" message="tns:search_faultMsg"/>
 </wsdl:operation>
 <wsdl:operation name="buy">
 <wsdl:input message="tns:buyRequest"/>
 <wsdl:output message="tns:buyResponse"/>
 <wsdl:fault name="fault" message="tns:buy_faultMsg"/>
 </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="ServiceSoapBinding" type="tns:ISampleService">
 <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
 <wsdl:operation name="login">
 <soap:operation soapAction="http://www.soapui.org/sample/login"/>
 <wsdl:input>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:output>
 <wsdl:fault name="fault">
 <soap:fault use="literal" name="fault"/>
 </wsdl:fault>
 </wsdl:operation>
 <wsdl:operation name="logout">
 <soap:operation soapAction="http://www.soapui.org/sample/logout"/>
 <wsdl:input>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:output>
 <wsdl:fault name="fault">
 <soap:fault use="literal" name="fault"/>
 </wsdl:fault>
 </wsdl:operation>
 <wsdl:operation name="search">
 <soap:operation soapAction="http://www.soapui.org/sample/search"/>
 <wsdl:input>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:output>
 <wsdl:fault name="fault">
 <soap:fault use="literal" name="fault"/>
 </wsdl:fault>
 </wsdl:operation>
 <wsdl:operation name="buy">
 <soap:operation soapAction="http://www.soapui.org/sample/buy"/>
 <wsdl:input>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:input>
 <wsdl:output>
 <soap:body use="literal" namespace="http://www.soapui.org/sample/"/>
 </wsdl:output>
 <wsdl:fault name="fault">
 <soap:fault use="literal" name="fault"/>
 </wsdl:fault>
 </wsdl:operation>
 </wsdl:binding>
 <wsdl:service name="SampleService">
 <wsdl:port name="SamplePort" binding="tns:ServiceSoapBinding">
 <soap:address location="http://www.soapui.org/sample"/>
 </wsdl:port>
 </wsdl:service>
</wsdl:definitions></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache></con:interface><con:testSuite name="Simple TestSuite" id="787b810e-159d-41eb-8550-daf7237b6f43"><con:description>This is a sample TestSuite.

It contains a number of TestCases Illustrating a number of principles with SoapUI.

Try each test and read the descriptions.</con:description><con:settings><con:setting id="ExportJUnitReportAction@report-directory">C:\dev\testreport</con:setting><con:setting id="ExportJUnitReportAction@clear-existing">true</con:setting><con:setting id="ExportJUnitReportAction@format">Frames</con:setting><con:setting id="CreateReportAction@report-directory">C:\dev\testreport</con:setting><con:setting id="CreateReportAction@format">Multiple Pages</con:setting><con:setting id="IncludeOverview">true</con:setting><con:setting id="IncludeResults">true</con:setting><con:setting id="FlowLayout">false</con:setting><con:setting id="ErrorDetails">true</con:setting><con:setting id="IncludeCoverage">true</con:setting><con:setting id="ReportTitle">Default Title</con:setting></con:settings><con:runType>SEQUENTIAL</con:runType><con:testCase failOnError="true" failTestCaseOnErrors="true" keepSession="false" name="Simple Login and Logout w. Properties Steps" searchProperties="true" maxResults="0" id="e8612cf4-e26a-4fd6-a962-1890de8c2e4b"><con:description>TestCase - Simple Login and Logout

This one is easy...

The test will first login and then it will logout. :-)

We are using a Property Transfer Step to move password and user name from a Properties Step to the 
Request and a second Property Transfer Step to move the sessionID we got in the login response to the logout request..</con:description><con:settings><con:setting id="ReportTitle">Default Titlkjle</con:setting></con:settings><con:testStep type="properties" name="Properties - Username and Password" id="672036e9-5dfe-450d-affd-30e51ae673ae"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>Username</con:name><con:value>Loginn${=String.valueOf(Math.random()).substring( 0, 5 )}</con:value></con:property><con:property><con:name>Password</con:name><con:value>Loginn123</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer - Move Username and Password" id="f83e2e8e-f4c2-4909-b917-e420e685e294"><con:settings/><con:config xsi:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" ignoreEmpty="false" transferChildNodes="false" useXQuery="false" entitize="false"><con:name>TransferUser</con:name><con:sourceType>Username</con:sourceType><con:sourceStep>Properties - Username and Password</con:sourceStep><con:targetType>Request</con:targetType><con:targetStep>Test Request - login</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:login/username</con:targetPath><con:upgraded>true</con:upgraded></con:transfers><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" transferToAll="false"><con:name>TransferPass</con:name><con:sourceType>Password</con:sourceType><con:sourceStep>Properties - Username and Password</con:sourceStep><con:targetType>Request</con:targetType><con:targetStep>Test Request - login</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:login/password</con:targetPath><con:upgraded>true</con:upgraded></con:transfers></con:config></con:testStep><con:testStep type="request" name="Test Request - login" id="6e975e9b-dfe2-41a2-85b5-c753a5d74174"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>login</con:operation><con:request name="Test Request - login" outgoingWss="" incomingWss="" id="eb771584-ad25-4a49-9316-39c466a4fe04"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:login>
 <username>Loginn${=String.valueOf(Math.random()).substring( 0, 5 )}</username>
 <password>Loginn123</password>
 </sam:login>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="eccf80d5-60f4-48e8-9551-4f8c7d9efb8e"/><con:assertion type="Schema Compliance" id="d5e307b0-a7a8-4e94-9249-6d2fc9dc4f24"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="e7bfc8ec-06aa-4acf-afba-e6faa2b26263"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer - Move sessionID" id="8323a779-5f45-4b84-8c3c-f3d4fd8d3f2e"><con:settings/><con:config xsi:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" transferToAll="false" ignoreEmpty="false"><con:name>MoveSessionId</con:name><con:sourceType>Response</con:sourceType><con:sourceStep>Test Request - login</con:sourceStep><con:sourcePath>declare namespace sam='http://www.soapui.org/sample/';
//sam:loginResponse/sessionid</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Test Request - logout</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:logout/sessionid</con:targetPath><con:upgraded>true</con:upgraded></con:transfers></con:config></con:testStep><con:testStep type="request" name="Test Request - logout" id="01263731-d2ee-432f-9335-462e588bc81a"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>logout</con:operation><con:request name="Test Request - logout" outgoingWss="" incomingWss="" id="b8be4b90-b87f-487b-8574-a329f4e12d4a"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>18898998985181625</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="6cf16cc9-70f8-43c6-b87c-76ac96bc9227"/><con:assertion type="Schema Compliance" id="5703a506-38bb-4201-973a-60dd2515808b"><con:configuration/></con:assertion><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:loadTest name="LoadTest 1" id="cf80df0c-65a0-4c3c-8d31-f9d7a312640e"><con:settings><con:setting id="ReportTitle">Default Title</con:setting><con:setting id="HttpSettings@close-connections">false</con:setting></con:settings><con:threadCount>5</con:threadCount><con:startDelay>0</con:startDelay><con:sampleInterval>250</con:sampleInterval><con:calculateTPSOnTimePassed>false</con:calculateTPSOnTimePassed><con:resetStatisticsOnThreadCountChange>true</con:resetStatisticsOnThreadCountChange><con:historyLimit>-1</con:historyLimit><con:testLimit>60</con:testLimit><con:limitType>TIME</con:limitType><con:loadStrategy><con:type>Simple</con:type></con:loadStrategy><con:assertion type="Step Status" name="Step Status"/><con:maxAssertionErrors>100</con:maxAssertionErrors><con:statisticsLogFolder/><con:statisticsLogInterval>0</con:statisticsLogInterval><con:logStatisticsOnThreadChange>false</con:logStatisticsOnThreadChange><con:cancelOnReachedLimit>false</con:cancelOnReachedLimit><con:cancelExcessiveThreads>true</con:cancelExcessiveThreads><con:strategyInterval>500</con:strategyInterval><con:updateStatisticsPerTestStep>false</con:updateStatisticsPerTestStep><con:reportParameters/></con:loadTest><con:properties/><con:reportParameters><con:property><con:name>ReportTitle</con:name><con:value>${=testCase.name}</con:value></con:property></con:reportParameters></con:testCase><con:testCase failOnError="true" failTestCaseOnErrors="true" keepSession="false" name="Simple Login and Logout Property Expansion" searchProperties="true" maxResults="0" id="8ba8563f-2511-4a02-8f7c-8e3d537c2cb4"><con:description>TestCase - Simple Login and Logout

This one is easy and a little tighter than "Simple Login and Logout w. Properties Steps"

The test will first login and then it will logout. :-)

We are using a Property Transfer Step to move password and user name from a Properties 
Step to the Request and a second Property Transfer Step to move the sessionID we got in the login response to the logout request..</con:description><con:settings/><con:testStep type="properties" name="Properties - Username and Password" id="67ce344e-8ec7-4e2b-b550-387a4bf7ad58"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>Username</con:name><con:value>Loginn${=String.valueOf(Math.random()).substring( 0, 5 )}</con:value></con:property><con:property><con:name>Password</con:name><con:value>Loginu123</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="request" name="Test Request - login" id="3125e03f-16c5-4844-a687-67ade7f605e0"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>login</con:operation><con:request name="Test Request - login" outgoingWss="" incomingWss="" id="37ef55b0-c57f-4b33-a96d-30b03afef447"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:login>
 <username>${Properties - Username and Password#Username}</username>
 <password>${Properties - Username and Password#Password}</password>
 </sam:login>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="a616fa6e-8e15-41a9-b65c-c13942518227"/><con:assertion type="Schema Compliance" id="42564a82-20fa-421c-a89f-49ed5917f641"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="a7e60daf-3650-4e98-8604-f37f422bdab7"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="Test Request - logout" id="19409730-56d5-455c-b870-78a41f517b73"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>logout</con:operation><con:request name="Test Request - logout" outgoingWss="" incomingWss="" id="d96c05b9-b8fc-440d-99c7-12cd97f45780"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>${Test Request - login#Response#//sam:loginResponse/sessionid}</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="f1f2e41d-cb84-4131-8088-b6484bf3073f"/><con:assertion type="Schema Compliance" id="5c8b3d62-2c9e-4c99-b6fd-1e2fc6609efa"><con:configuration/></con:assertion><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:properties/><con:reportParameters/></con:testCase><con:testCase failOnError="true" failTestCaseOnErrors="true" keepSession="false" name="Simple Login and Logout and Login Again" searchProperties="true" maxResults="0" id="c70382f4-89b2-42f6-bf28-d14133e1dcb7"><con:description>TestCase - Simple Login and Logout

This one is a bit wonky, but has its reasons. What we are testing is that we are able to login again after a logout.

The test will:
1) login 
2) logout
3) login again
4) logout again 

The last step is there in order for us to be able to run the test continuously.</con:description><con:settings/><con:testStep type="properties" name="Properties - Username and Password" id="ba3ec237-e706-4a7f-94ab-79cb9c2d3c90"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>Username</con:name><con:value>Loginn${=String.valueOf(Math.random()).substring( 0, 5 )}</con:value></con:property><con:property><con:name>Password</con:name><con:value>Loginu123</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="request" name="Test Request - login" id="90d09900-dc9c-487c-bc4b-d30c3ae15177"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>login</con:operation><con:request name="Test Request - login" outgoingWss="" incomingWss="" id="0598ede4-b5fd-4c92-8e6f-54e50bfade3f"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:login>
 <username>${Properties - Username and Password#Username}</username>
 <password>${Properties - Username and Password#Password}</password>
 </sam:login>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="f21620c5-3ae0-4362-a48b-4dd82c19cc89"/><con:assertion type="Schema Compliance" id="190c9d9f-f81c-41c0-9ec5-e5793d2c39ef"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="933410c2-2cf2-427c-919b-dd57ca0168a3"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="Test Request - logout" id="c580aa91-a644-4074-9394-4795ef87f64d"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>logout</con:operation><con:request name="Test Request - logout" outgoingWss="" incomingWss="" id="28143abd-f9e8-407e-8435-734ae90e3d8e"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>${Test Request - login#Response#//sam:loginResponse/sessionid}</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="2907d4f4-61ad-4a72-8971-c55d709f496b"/><con:assertion type="Schema Compliance" id="0bfae5e7-f56b-4863-a205-eff59d30991a"><con:configuration/></con:assertion><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="Test Request - login again" id="74337a6b-77c4-42a5-9526-cca198c4b17d"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>login</con:operation><con:request name="Test Request - login again" outgoingWss="" incomingWss="" id="013d8c62-131c-459e-9582-22f72f709279"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:login>
 <username>${Properties - Username and Password#Username}</username>
 <password>${Properties - Username and Password#Password}</password>
 </sam:login>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="19304d61-7ced-4996-8430-eecfc0cb5f13"/><con:assertion type="Schema Compliance" id="40b36669-2669-4586-9e0a-05a42ac5192b"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="989dc0c3-359c-401e-870e-8ff211880e7b"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="Test Request - logout again" id="8d0d3553-61f2-48f2-9e9a-c858aac9d836"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>logout</con:operation><con:request name="Test Request - logout again" outgoingWss="" incomingWss="" id="7196e17e-a00d-4345-91d4-3e202ed24a56"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>${Test Request - login again#Response#//sam:loginResponse/sessionid}</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="86a1170e-efcd-49a6-b8a3-ca6401553c88"/><con:assertion type="Schema Compliance" id="3f988f0b-1777-4d5e-abd9-fbcf7da2174a"><con:configuration/></con:assertion><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:properties/><con:reportParameters/></con:testCase><con:testCase failOnError="true" failTestCaseOnErrors="true" keepSession="false" name="Simple Search TestCase" searchProperties="true" maxResults="0" id="b373e360-6b96-4588-b515-62a67d216546"><con:description>TestCase - Simple Search TestCase


The test extends the previous TastCases by doing a simple search between login and logout.

We are using a Property Transfer Step to move password and user name from a Properties Step to the 
Request and a second Property Transfer Step to move the sessionID we got in the login response to the logout request..</con:description><con:settings/><con:testStep type="properties" name="Properties - Username and Password" id="371d51e7-630b-4b03-92eb-1bedad9c5f07"><con:settings/><con:config xsi:type="con:PropertiesStep" saveFirst="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:properties><con:property><con:name>Username</con:name><con:value>Logini${=String.valueOf(Math.random()).substring( 0, 5 )}</con:value></con:property><con:property><con:name>Password</con:name><con:value>Logini123</con:value></con:property><con:property><con:name>SearchPhrase</con:name><con:value>Item 1</con:value></con:property></con:properties></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer - Move Username and Password" id="e3c99e33-142a-4896-bc1f-2ab14c32a835"><con:settings/><con:config xsi:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true"><con:name>TransferUser</con:name><con:sourceType>Username</con:sourceType><con:sourceStep>Properties - Username and Password</con:sourceStep><con:targetType>Request</con:targetType><con:targetStep>Test Request - login</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:login/username</con:targetPath><con:upgraded>true</con:upgraded></con:transfers><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" transferToAll="false"><con:name>TransferPass</con:name><con:sourceType>Password</con:sourceType><con:sourceStep>Properties - Username and Password</con:sourceStep><con:targetType>Request</con:targetType><con:targetStep>Test Request - login</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:login/password</con:targetPath><con:upgraded>true</con:upgraded></con:transfers></con:config></con:testStep><con:testStep type="request" name="Test Request - login" id="d2d531ae-8ddb-40da-8735-7039119d22ca"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>login</con:operation><con:request name="Test Request - login" outgoingWss="" incomingWss="" id="23ba5de1-d941-4ad4-bee7-3506545648fd"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:login>
 <username>Logini${=String.valueOf(Math.random()).substring( 0, 5 )}</username>
 <password>Logini123</password>
 </sam:login>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="d6e010a6-df88-4b19-a53e-5a9a1d91c98f"/><con:assertion type="Schema Compliance" id="943874d3-eca7-49c8-bc66-aa7ff6544da5"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="4d19c387-e61f-4edb-99ce-11b45567327e"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="transfer" name="Property Transfer - Move sessionID" id="8fe7ae80-eac0-49c1-8b9e-8aa62e082c8c"><con:settings/><con:config xsi:type="con:PropertyTransfersStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" transferToAll="false" ignoreEmpty="false"><con:name>MoveSessionId</con:name><con:sourceType>Response</con:sourceType><con:sourceStep>Test Request - login</con:sourceStep><con:sourcePath>declare namespace sam='http://www.soapui.org/sample/';
//sam:loginResponse/sessionid</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Test Request - logout</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:logout/sessionid</con:targetPath><con:upgraded>true</con:upgraded></con:transfers><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" ignoreEmpty="false" transferToAll="false"><con:name>moveSessionID Search</con:name><con:sourceType>Response</con:sourceType><con:sourceStep>Test Request - login</con:sourceStep><con:sourcePath>declare namespace sam='http://www.soapui.org/sample/';
//sam:loginResponse/sessionid</con:sourcePath><con:targetType>Request</con:targetType><con:targetStep>Test Request - search</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:search/sessionid</con:targetPath><con:upgraded>true</con:upgraded></con:transfers><con:transfers setNullOnMissingSource="true" transferTextContent="true" failOnError="true" ignoreEmpty="false" transferToAll="false"><con:name>MoveSearchstring</con:name><con:sourceType>SearchPhrase</con:sourceType><con:sourceStep>Properties - Username and Password</con:sourceStep><con:sourcePath/><con:targetType>Request</con:targetType><con:targetStep>Test Request - search</con:targetStep><con:targetPath>declare namespace sam='http://www.soapui.org/sample/';
//sam:search/searchstring</con:targetPath><con:upgraded>true</con:upgraded></con:transfers></con:config></con:testStep><con:testStep type="request" name="Test Request - search" id="da2736f5-1252-4237-a1b1-1e013b643cf6"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>search</con:operation><con:request name="Test Request - search" outgoingWss="" incomingWss="" id="32b115c8-e933-49a3-b4e4-5e0b9586428d"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:search>
 <sessionid>1883226700759958</sessionid>
 <searchstring>Item 1</searchstring>
 </sam:search>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="18c3bb27-f4af-4dba-8bbf-ba281e8a2d79"/><con:assertion type="Schema Compliance" id="56208e31-21e6-46e4-9501-3c9414081f3e"><con:configuration/></con:assertion><con:assertion type="SOAP Fault Assertion" id="06440ca6-1d1c-4097-944b-a687f7979e35"/><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:testStep type="request" name="Test Request - logout" id="ae6ed91b-f254-48a8-806e-f0d53dd4ba18"><con:settings/><con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:interface>ServiceSoapBinding</con:interface><con:operation>logout</con:operation><con:request name="Test Request - logout" outgoingWss="" incomingWss="" id="44ad4f70-0d9a-4206-b78c-567df4594a51"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://127.0.0.1:8088/mockServiceSoapBinding</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logout>
 <sessionid>1883226700759958</sessionid>
 </sam:logout>
 </soapenv:Body>
</soapenv:Envelope>]]></con:request><con:assertion type="SOAP Response" id="265c6da2-f1a4-43f5-8012-a6fbfea0fd02"/><con:assertion type="Schema Compliance" id="34307f80-7d6d-498e-ab82-e09eddbbf6a8"><con:configuration/></con:assertion><con:credentials><con:username xsi:nil="true"/><con:password xsi:nil="true"/><con:domain xsi:nil="true"/><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/><con:wsrmConfig version="1.2"/></con:request></con:config></con:testStep><con:properties/><con:reportParameters/></con:testCase><con:properties/><con:setupScript/><con:tearDownScript/><con:reportScript>import soapui.demo.subreport.SystemPropertiesSubReport

if( !report.hasSubReport( "SystemProperties" ))
{
	report.addSubReport( new SystemPropertiesSubReport( testSuite ))
}
	</con:reportScript><con:reportParameters/></con:testSuite><con:testSuite id="ee0ee8ff-a1d4-42e4-ad2b-013d4cc897b8" name="Test Suite Clone Examples"><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="b7a047de-72b2-41e2-b711-fda30c663603" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Invoke CloneTestSuiteAction.cloneToAnotherProject" searchProperties="true"><con:settings/><con:testStep type="groovy" name="Groovy Script" id="48ab5c16-6038-4367-988d-8e245bcdccbd"><con:settings/><con:config><script>import com.eviware.soapui.impl.wsdl.actions.testsuite.CloneTestSuiteAction

def sourceTestSuite = context.getTestCase().getTestSuite().getProject()
 .getTestSuiteByName("Simple TestSuite")

CloneTestSuiteAction.cloneToAnotherProject (
	sourceTestSuite,
	"Destination project using original action",
	"New copy of Simple TestSuite",
	false, //move instead of copy?
	sourceTestSuite.description
)</script></con:config></con:testStep><con:properties/></con:testCase><con:testCase id="d3f254f2-cd09-4936-9768-03611ca333e9" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Custom clone action without user inputs" searchProperties="true"><con:settings/><con:testStep type="groovy" name="Groovy Script" id="30996b1b-504f-488a-b035-69e628fafd18"><con:settings/><con:config><script>import com.eviware.soapui.impl.wsdl.actions.testsuite.CloneTestSuiteAction

import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
import com.eviware.soapui.impl.WorkspaceImpl;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.impl.support.AbstractInterface;
import com.eviware.soapui.model.iface.Interface;

def sourceTestSuite = context.getTestCase().getTestSuite().getProject()
 .getTestSuiteByName("Simple TestSuite")

MyCustomCloneTestSuiteAction.cloneToAnotherProject (
	sourceTestSuite,
	"Destination project from custom action",
	"New copy of Simple TestSuite",
	false, //move instead of copy?
	sourceTestSuite.description,
	true // NEW: clone interfaces?
)

class MyCustomCloneTestSuiteAction extends CloneTestSuiteAction {

	public static WsdlTestSuite cloneToAnotherProject(WsdlTestSuite testSuite, String targetProjectName, String name,
	                                                 boolean move, String description, /*NEW*/ boolean cloneInterfaces) {
	   WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
	   WsdlProject targetProject = (WsdlProject) workspace.getProjectByName(targetProjectName);
	   if (targetProject == null) {
	       if (targetProjectName == null) {
	           return null;
	       }
	       targetProject = workspace.createProject(targetProjectName, null);
	       if (targetProject == null) {
	           return null;
	       }
	   }
	
	   Set&lt;Interface> requiredInterfaces = getRequiredInterfaces(testSuite, targetProject);

  	  if (cloneInterfaces) { // use argument instead
           for (Interface iface : requiredInterfaces) {
               targetProject.importInterface((AbstractInterface&lt;?>) iface, true, true);
           }
       }
	
	   testSuite = targetProject.importTestSuite(testSuite, name, -1, !move, description);

	   return testSuite;
	}
	
}</script></con:config></con:testStep><con:testStep type="groovy" name="Original source code" id="1c96dee3-09a2-4912-8f74-2d7ffcf8e6dc" disabled="true"><con:settings/><con:config><script><![CDATA[/*
 * SoapUI, Copyright (C) 2004-2017 SmartBear Software
 *
 * Licensed under the EUPL, Version 1.1 or - as soon as they will be approved by the European Commission - subsequent 
 * versions of the EUPL (the "Licence"); 
 * You may not use this work except in compliance with the Licence. 
 * You may obtain a copy of the Licence at: 
 * 
 * http://ec.europa.eu/idabc/eupl 
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the Licence is 
 * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied. See the Licence for the specific language governing permissions and limitations 
 * under the Licence. 
 */

package com.eviware.soapui.impl.wsdl.actions.testsuite;

import com.eviware.soapui.impl.WorkspaceImpl;
import com.eviware.soapui.impl.support.AbstractInterface;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
import com.eviware.soapui.impl.wsdl.support.HelpUrls;
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
import com.eviware.soapui.model.iface.Interface;
import com.eviware.soapui.model.support.ModelSupport;
import com.eviware.soapui.model.testsuite.TestSuite;
import com.eviware.soapui.support.SoapUIException;
import com.eviware.soapui.support.UISupport;
import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
import com.eviware.soapui.support.action.swing.ActionList;
import com.eviware.soapui.support.action.swing.DefaultActionList;
import com.eviware.x.form.XFormDialog;
import com.eviware.x.form.XFormField;
import com.eviware.x.form.XFormFieldListener;
import com.eviware.x.form.support.ADialogBuilder;
import com.eviware.x.form.support.AField;
import com.eviware.x.form.support.AField.AFieldType;
import com.eviware.x.form.support.AForm;

import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Clones a WsdlTestSuite
 *
 * @author Ole.Matzura
 */

public class CloneTestSuiteAction extends AbstractSoapUIAction<WsdlTestSuite> {
    private XFormDialog dialog;

    public CloneTestSuiteAction() {
        super("Clone TestSuite", "Clones this TestSuite");
    }

    public void perform(final WsdlTestSuite testSuite, Object param) {
        if (dialog == null) {
            ActionList actions = new DefaultActionList();

            final AbstractAction cloneAction = new AbstractAction("Clone") {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (dialog.validate()) {
                        dialog.setVisible(false);

                        String targetProjectName = dialog.getValue(Form.PROJECT);
                        String name = dialog.getValue(Form.NAME);

                        WsdlProject project = testSuite.getProject();

                        // within same project?
                        boolean move = dialog.getBooleanValue(Form.MOVE);
                        boolean cloneDescription = dialog.getBooleanValue(Form.CLONE_DESCRIPTION);
                        String description = testSuite.getDescription();
                        if (!cloneDescription) {
                            description = dialog.getValue(Form.DESCRIPTION);
                        }

                        TestSuite result;

                        if (targetProjectName.equals(testSuite.getProject().getName())) {
                            result = cloneTestSuiteWithinProject(testSuite, name, project, description);
                        } else {
                            result = cloneToAnotherProject(testSuite, targetProjectName, name, move, description);
                        }

                        if (move && result != null) {
                            testSuite.getProject().removeTestSuite(testSuite);
                        }
                    }
                }
            };
            actions.addAction(cloneAction);

            actions.addAction(new AbstractAction("Cancel") {
                @Override
                public void actionPerformed(ActionEvent e) {
                    dialog.setVisible(false);
                }
            });
            actions.setDefaultAction(cloneAction);


            dialog = ADialogBuilder.buildDialog(Form.class, actions, false);
        }

        dialog.getFormField(Form.CLONE_DESCRIPTION).addFormFieldListener(new XFormFieldListener() {

            public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                if (dialog.getBooleanValue(Form.CLONE_DESCRIPTION)) {
                    dialog.getFormField(Form.DESCRIPTION).setEnabled(false);
                } else {
                    dialog.getFormField(Form.DESCRIPTION).setEnabled(true);
                }

            }
        });
        dialog.setValue(Form.NAME, "Copy of " + testSuite.getName());
        dialog.setBooleanValue(Form.MOVE, false);
        dialog.setBooleanValue(Form.CLONE_DESCRIPTION, true);
        dialog.getFormField(Form.DESCRIPTION).setEnabled(false);
        dialog.setValue(Form.DESCRIPTION, testSuite.getDescription());

        WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
        dialog.setOptions(Form.PROJECT,
                ModelSupport.getNames(workspace.getOpenProjectList(), new String[]{"<Create New>"}));

        dialog.setValue(Form.PROJECT, testSuite.getProject().getName());

        dialog.show();
    }

    public static WsdlTestSuite cloneToAnotherProject(WsdlTestSuite testSuite, String targetProjectName, String name,
                                                      boolean move, String description) {
        WorkspaceImpl workspace = testSuite.getProject().getWorkspace();
        WsdlProject targetProject = (WsdlProject) workspace.getProjectByName(targetProjectName);
        if (targetProject == null) {
            targetProjectName = UISupport.prompt("Enter name for new Project", "Clone TestSuite", "");
            if (targetProjectName == null) {
                return null;
            }

            try {
                targetProject = workspace.createProject(targetProjectName, null);
            } catch (SoapUIException e) {
                UISupport.showErrorMessage(e);
            }

            if (targetProject == null) {
                return null;
            }
        }

        Set<Interface> requiredInterfaces = getRequiredInterfaces(testSuite, targetProject);

        if (requiredInterfaces.size() > 0) {
            String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";
            for (Interface iface : requiredInterfaces) {
                msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";
            }
            msg += "\r\nShould these be cloned to the targetProject as well?";

            Boolean result = UISupport.confirmOrCancel(msg, "Clone TestSuite");
            if (result == null) {
                return null;
            }

            if (result) {
                for (Interface iface : requiredInterfaces) {
                    targetProject.importInterface((AbstractInterface<?>) iface, true, true);
                }
            }
        }

        testSuite = targetProject.importTestSuite(testSuite, name, -1, !move, description);
        UISupport.select(testSuite);

        return testSuite;
    }

    public static TestSuite cloneTestSuiteWithinProject(WsdlTestSuite testSuite, String name, WsdlProject project,
                                                        String description) {
        WsdlTestSuite newTestSuite = project.importTestSuite(testSuite, name, -1, true, description);
        UISupport.select(newTestSuite);
        return newTestSuite;
    }

    public static Set<Interface> getRequiredInterfaces(WsdlTestSuite testSuite, WsdlProject targetProject) {
        Set<Interface> requiredInterfaces = new HashSet<Interface>();

        for (int i = 0; i < testSuite.getTestCaseCount(); i++) {
            WsdlTestCase testCase = testSuite.getTestCaseAt(i);

            for (int y = 0; y < testCase.getTestStepCount(); y++) {
                WsdlTestStep testStep = testCase.getTestStepAt(y);
                requiredInterfaces.addAll(testStep.getRequiredInterfaces());
            }
        }

        if (requiredInterfaces.size() > 0 && targetProject.getInterfaceCount() > 0) {
            Map<String, Interface> bindings = new HashMap<String, Interface>();
            for (Interface iface : requiredInterfaces) {
                bindings.put(iface.getTechnicalId(), iface);
            }

            for (Interface iface : targetProject.getInterfaceList()) {
                bindings.remove(iface.getTechnicalId());
            }

            requiredInterfaces.retainAll(bindings.values());
        }
        return requiredInterfaces;
    }

    @AForm(description = "Specify target Project and name of cloned TestSuite", name = "Clone TestSuite", helpUrl = HelpUrls.CLONETESTSUITE_HELP_URL, icon = UISupport.TOOL_ICON_PATH)
    protected interface Form {
        @AField(name = "TestSuite Name", description = "The name of the cloned TestSuite", type = AFieldType.STRING)
        public final static String NAME = "TestSuite Name";

        @AField(name = "Target Project", description = "The target Project for the cloned TestSuite", type = AFieldType.ENUMERATION)
        public final static String PROJECT = "Target Project";

        @AField(name = "Move instead", description = "Moves the selected TestSuite instead of copying", type = AFieldType.BOOLEAN)
        public final static String MOVE = "Move instead";

        @AField(name = "Clone description", description = "Clones the description of selected TestSuite", type = AFieldType.BOOLEAN)
        public final static String CLONE_DESCRIPTION = "Clone description";

        @AField(name = "Description", description = "Description of new TestSuite", type = AFieldType.STRINGAREA)
        public final static String DESCRIPTION = "Description";
    }
}
]]></script></con:config></con:testStep><con:properties/></con:testCase><con:properties/></con:testSuite><con:mockService port="8088" path="/mockServiceSoapBinding" name="ServiceSoapBinding MockService" host="localhost" id="fb74deac-ab76-406d-8447-5ad17e5a3889"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.mock.WsdlMockService@require-soap-action">false</con:setting></con:settings><con:mockOperation name="login" interface="ServiceSoapBinding" operation="login" id="e2f560ac-6cc4-44c1-b86c-f1b88e47e02c"><con:settings/><con:dispatchPath>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )

def username = holder.getNodeValue( "//username" )
def password = holder.getNodeValue( "//password" )
def sum = username + password

// validate
if( sum.length() > 25 || sum.length() &lt; 10 || !username.startsWith("Login") || !password.endsWith( "123" ))
 return "Invalid Login Fault"

if( context.hasProperty( sum ))
 return "Already Logged In Fault"

// seems ok
def sessionid = String.valueOf( Math.random() ).substring( 2 )

context.setProperty( sum, sessionid )
context.setProperty( sessionid, sum )

requestContext.sessionid = sessionid
return "Ok Response"
</con:dispatchPath><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:defaultResponse>Ok Response</con:defaultResponse><con:response name="Ok Response" encoding="UTF-8" httpResponseStatus="200" id="cd9cfc44-3af5-48e3-a27a-622fce77fee8"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:loginResponse>
 <sessionid>${sessionid}</sessionid>
 </sam:loginResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Invalid Login Fault" encoding="UTF-8" httpResponseStatus="200" id="7a0f23a5-d4ae-48c5-8686-255763693a82"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Invalid Login</faultstring>
 <detail>
 <sam:loginFault>The login credentials are invalid</sam:loginFault>
 </detail>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Already Logged In Fault" encoding="UTF-8" httpResponseStatus="200" id="e3a6ce2f-5282-4351-a55f-0587a71d4091"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Already Login</faultstring>
 <detail>
 <sam:loginFault>The specified credentials are already logged in</sam:loginFault>
 </detail>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:dispatchConfig/></con:mockOperation><con:mockOperation name="logout" interface="ServiceSoapBinding" operation="logout" id="88b54c36-533f-46c8-9880-6778377376a9"><con:settings/><con:dispatchPath>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )

def sessionid = holder.getNodeValue( "//sessionid" )

// check
if( !context.hasProperty( sessionid ))
 return "Invalid Session Id Fault"

// logout
context.removeProperty( context.getProperty( sessionid ))
context.removeProperty( sessionid )
requestContext.sessioninfo = "OK"

return "Ok Response"
</con:dispatchPath><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:defaultResponse>Response 1</con:defaultResponse><con:response name="Ok Response" encoding="UTF-8" httpResponseStatus="200" id="2eeb157f-2920-43c3-9a23-9771ce120a38"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:logoutResponse>
 <sessioninfo>${sessioninfo}</sessioninfo>
 </sam:logoutResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Invalid Session Id Fault" encoding="UTF-8" httpResponseStatus="200" id="55f8ab06-d98e-44d9-8252-290eaf10aaf8"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Invalid Session Id</faultstring>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:dispatchConfig/></con:mockOperation><con:mockOperation name="search" interface="ServiceSoapBinding" operation="search" id="2648d33a-31ad-4a4d-ba84-eb331d93ede6"><con:settings/><con:dispatchPath>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )

def sessionid = holder.getNodeValue( "//sessionid" )

// check
if( !context.hasProperty( sessionid ))
 return "Invalid Session Id Fault"

def searchstring = holder.getNodeValue( "//searchstring" )

if (searchstring == "all") 
 return "WildCard Response"
else if (searchstring == "Item 1") 
 return "Item 1 Response"
else if (searchstring == "Item 2") 
 return "Item 2 Response"
else if (searchstring == "Item 3") 
 return "Item 3 Response"
else if (searchstring == "Item 4") 
 return "Item 3 Response"
else if (searchstring == "Item 5") 
 return "Item 5 Response"
else
return "Unknown Response" 
	


return "Search Response"</con:dispatchPath><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:defaultResponse>Response 1</con:defaultResponse><con:response name="Search Response" encoding="UTF-8" httpResponseStatus="200" id="36155785-cfd9-4a47-9d7a-143737c655bf"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>1</id>
 <description>One handy protocol droid.</description>
 <price>1</price>
 </item>
 <item>
 <id>2</id>
 <description>Item nr 2</description>
 <price>2</price>
 </item>
 <item>
 <id>3</id>
 <description>Item nr 3</description>
 <price>3</price>
 </item>
 <item>
 <id>4</id>
 <description>${item4description}</description>
 <price>4</price>
 </item>
 <item>
 <id>5</id>
 <description>Item nr 5</description>
 <price>5</price>
 </item>
 </sam:searchResponseContent>
 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Invalid Session Id Fault" encoding="UTF-8" httpResponseStatus="200" id="fc4ecd28-0a9d-44d8-b2b9-d36040203cc6"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Invalid Session Id</faultstring>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 1 Response" encoding="UTF-8" httpResponseStatus="200" id="a97ed3ca-0b62-4177-9704-82ba5bda8d34"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 	 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>Item 1</id>
 <description>One handy protocol droid. This droid is fluent 
		in over six million forms of communication and has a lovely golden color. 
		Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
 <price>1</price>
 </item>
 </sam:searchResponseContent>
		</sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 2 Response" encoding="UTF-8" httpResponseStatus="200" id="a2d17aea-9ede-4f5a-80bb-1dfdb41a1094"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
	 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>Item 2</id>
 <description>Box of chocolate with several popular items. Covered in Glucose.
		Recommended safety distance when eating Spring Surprise, 10 feet.</description>
 <price>1.99</price>
 </item>
 </sam:searchResponseContent>
	 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 3 Response" encoding="UTF-8" httpResponseStatus="200" id="891965a2-6336-410f-942e-614e5d5edcc2"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
	 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>Item 3</id>
 <description>One towel. Massively useful thing. 
Impress the strags with this amazing cloth!</description>
 <price>2.99</price>
 </item>
 </sam:searchResponseContent>
	 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 4 Response" encoding="UTF-8" httpResponseStatus="200" id="b17648f1-6ba6-4892-9579-123970f57e5f"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
	 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>item 4</id>
 <description>Ono-Sendai 7. The newest cowboy tech from Hosaka. 
		Break the ICE with this conversation piece.</description>
 <price>4.99</price>
 </item>
 </sam:searchResponseContent>
 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 5 Response" encoding="UTF-8" httpResponseStatus="200" id="c623b634-415e-468c-b067-1b1729148834"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
	 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>item 5</id>
 <description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
 <price>349</price>
 </item>
 <sam:searchResponseContent>
 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Search Fault Response" encoding="UTF-8" httpResponseStatus="200" id="091ae2fa-56d3-4dd6-ac3d-85b123470f54"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Server</faultcode>
 <faultstring>No Result</faultstring>
 <detail>
 <sam:loginFault>The search returned no items</sam:loginFault>
 </detail>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Unknown Response" encoding="UTF-8" httpResponseStatus="200" id="946a8e21-c04b-4b6d-bd58-da659160554b"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Unknown Search String</faultstring>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="WildCard Response" encoding="UTF-8" httpResponseStatus="200" id="56dae8a8-c20e-474f-83a3-5c85dc386c4e"><con:settings/><con:script>context.item4description = Math.random() > 0.9 ? "garbage" : "Item nr 4"</con:script><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:searchResponse>
 <sam:searchResponseContent>
 <item>
 <id>Item 1</id>
 <description>One handy protocol droid. This droid is fluent 
		in over six million forms of communication and has a lovely golden color. 
		Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
 <price>1</price>
 </item>
 <item>
 <id>Item 2</id>
 <description>Box of chocolate with several popular items. Covered in Glucose.
		Recommended safety distance when eating Spring Surprise, 10 feet.</description>
 <price>1.99</price>
 </item>
 <item>
 <id>Item 3</id>
 <description>One towel. Massively useful thing. 
Impress the strags with this amazing cloth!</description>
 <price>2.99</price>
 </item>
 <item>
 <id>Item 4</id>
 <description>Ono-Sendai 7. The newest cowboy tech from Hosaka. 
		Break the ICE with this conversation piece.</description>
 <price>4.99</price>
 </item>
 <item>
 <id>Item 5</id>
 <description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
 <price>349</price>
 </item>
 </sam:searchResponseContent>
 </sam:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:dispatchConfig/></con:mockOperation><con:mockOperation name="buy" interface="ServiceSoapBinding" operation="buy" id="eaa3bf1b-2ee5-4152-aae1-a39388709413"><con:settings/><con:dispatchPath>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )

def sessionid = holder.getNodeValue( "//sessionid" )

// check
if( !context.hasProperty( sessionid ))
 return "Invalid Session Id Fault"

def buystring = holder.getNodeValue( "//buystring" )

if (buystring == "all") 
 return "WildCard Response"
else if (buystring == "Item 1") 
 return "Item 1 Response"
else if (buystring == "Item 2") 
 return "Item 2 Response"
else if (buystring == "Item 3") 
 return "Item 3 Response"
else if (buystring == "Item 4") 
 return "Item 3 Response"
else if (buystring == "Item 5") 
 return "Item 5 Response"
else
return "Unknown Response" 
	


return "Search Response"</con:dispatchPath><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:defaultResponse>Buy Response</con:defaultResponse><con:response name="Buy Response" encoding="UTF-8" httpResponseStatus="200" id="2ef78c0d-d390-4bfb-8fd8-266551a254a2"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>?</id>
 <stockStatus>?</stockStatus>
 <expectedDelivery>?</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 1 Response" encoding="UTF-8" httpResponseStatus="200" id="990eba5a-c285-42d9-9dc0-07398e20363d"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 1</id>
 <stockStatus>1 unit</stockStatus>
 <expectedDelivery>2000 years from now</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 2 Response" encoding="UTF-8" httpResponseStatus="200" id="d6ecb076-9580-40be-a3d8-d083ebee5d32"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 2</id>
 <stockStatus>10 000 boxes</stockStatus>
 <expectedDelivery>1 week</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 3 Response" encoding="UTF-8" httpResponseStatus="200" id="55decb43-a340-43db-a0db-9cd66cf8a588"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 3</id>
 <stockStatus>4 towels</stockStatus>
 <expectedDelivery>Any day now...</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 4 Response" encoding="UTF-8" httpResponseStatus="200" id="dc12b33f-114d-42c1-a081-3e99f079a0f4"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 4</id>
 <stockStatus>1 unit</stockStatus>
 <expectedDelivery>In the near future.</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Item 5 Response" encoding="UTF-8" httpResponseStatus="200" id="87144b1f-8aaf-4143-8a3e-9b04c92c2dcc"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 5</id>
 <stockStatus>1 license</stockStatus>
 <expectedDelivery>You should already have it.</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Invalid Session Id Fault" encoding="UTF-8" httpResponseStatus="200" id="4a261658-19ec-4ba6-9bf1-d727e63ab5d5"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
 <soapenv:Fault>
 <faultcode>Client</faultcode>
 <faultstring>Invalid Session Id</faultstring>
 </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="Unknown Response" encoding="UTF-8" httpResponseStatus="200" id="7d965d01-ef3d-4aad-88b9-e61c3574e627"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>?</id>
 <stockStatus>?</stockStatus>
 <expectedDelivery>?</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:response name="WildCard Response" encoding="UTF-8" httpResponseStatus="200" id="6b213927-8144-4a99-9d10-05429612f34c"><con:settings/><con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
 <soapenv:Header/>
 <soapenv:Body>
 <sam:buyResponse>
 <sam:buyResponseContent>
 <purchasestatus>
 <id>Item 1</id>
 <stockStatus>1 unit</stockStatus>
 <expectedDelivery>2000 years from now</expectedDelivery>
 </purchasestatus>
 <purchasestatus>
 <id>Item 2</id>
 <stockStatus>10 000 boxes</stockStatus>
 <expectedDelivery>1 week</expectedDelivery>
 </purchasestatus>
	 <purchasestatus>
 <id>Item 3</id>
 <stockStatus>4 towels</stockStatus>
 <expectedDelivery>Any day now...</expectedDelivery>
 </purchasestatus>
 <purchasestatus>
 <id>Item 4</id>
 <stockStatus>1 unit</stockStatus>
 <expectedDelivery>In the near future.</expectedDelivery>
 </purchasestatus>'
 <purchasestatus>
 <id>Item 5</id>
 <stockStatus>1 license</stockStatus>
 <expectedDelivery>You should already have it.</expectedDelivery>
 </purchasestatus>
 </sam:buyResponseContent>
 </sam:buyResponse>
 </soapenv:Body>
</soapenv:Envelope>]]></con:responseContent><con:wsaConfig mustUnderstand="NONE" version="200508"/></con:response><con:dispatchConfig/></con:mockOperation><con:properties/><con:onRequestScript/></con:mockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/><con:sensitiveInformation/></con:soapui-project>