HsacExamples.SlimTests.HttpTests.HttpPost2UsingScenarioTest


Body via scenario


Using a scenario allows us to generate multiple request, only changing certain values.

Scenario definition

variable defined: POST_BODY_2= {{{ <s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"> <s11:Body> <ns1:AddInteger xmlns:ns1="http://tempuri.org"> <ns1:Arg1>@{arg1}</ns1:Arg1> <ns1:Arg2>@{arg2}</ns1:Arg2> </ns1:AddInteger> </s11:Body> </s11:Envelope> }}}

script xml http test

table template send request
set value http://tempuri.org/SOAP.Demo.AddInteger for header SOAPAction
post
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
  <s11:Body>
    <ns1:AddInteger xmlns:ns1="http://tempuri.org">
      <ns1:Arg1>@{arg1}</ns1:Arg1>
      <ns1:Arg2>@{arg2}</ns1:Arg2>
    </ns1:AddInteger>
  </s11:Body>
</s11:Envelope>
to http://www.crcind.com/csp/samples/SOAP.Demo.cls
check response status 200
show response
register prefix tempuri for namespace http://tempuri.org
$result= xPath //tempuri:AddIntegerResult/text()

send request
arg1 arg2 result?
1 1 2
table template send request
set value http://tempuri.org/SOAP.Demo.AddInteger for header SOAPAction
post
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
  <s11:Body>
    <ns1:AddInteger xmlns:ns1="http://tempuri.org">
      <ns1:Arg1>1</ns1:Arg1>
      <ns1:Arg2>1</ns1:Arg2>
    </ns1:AddInteger>
  </s11:Body>
</s11:Envelope>
to http://www.crcind.com/csp/samples/SOAP.Demo.cls
check response status 200
show response
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <AddIntegerResponse xmlns="http://tempuri.org">
            <AddIntegerResult>2</AddIntegerResult>
        </AddIntegerResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
register prefix tempuri for namespace http://tempuri.org
$result<-[2] xPath //tempuri:AddIntegerResult/text()
34 16 50
table template send request
set value http://tempuri.org/SOAP.Demo.AddInteger for header SOAPAction
post
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
  <s11:Body>
    <ns1:AddInteger xmlns:ns1="http://tempuri.org">
      <ns1:Arg1>34</ns1:Arg1>
      <ns1:Arg2>16</ns1:Arg2>
    </ns1:AddInteger>
  </s11:Body>
</s11:Envelope>
to http://www.crcind.com/csp/samples/SOAP.Demo.cls
check response status 200
show response
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <AddIntegerResponse xmlns="http://tempuri.org">
            <AddIntegerResult>50</AddIntegerResult>
        </AddIntegerResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
register prefix tempuri for namespace http://tempuri.org
$result<-[50] xPath //tempuri:AddIntegerResult/text()