Soapui request in gatling

154 views
Skip to first unread message

Saranya Jyothiramalingam

unread,
Sep 9, 2015, 2:52:42 AM9/9/15
to Gatling User Group
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:outgoingTransaction soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:OutgoingTransaction">
<pobjWSOutgoingTransactionRqstInfo xsi:type="out:OutgoingTransactionRqstInfo" xs:type="type:OutgoingTransactionRqstInfo" xmlns:out="http://www.wavecrest.com/OutgoingTransactionService" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">
<messageID xsi:type="xsd:int" xs:type="type:int">2342343</messageID>
<instCode xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">WAV</instCode>
<txnType xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">19</txnType>
<msgType xsi:type="xsd:int" xs:type="type:int">100</msgType>
<tlogId xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">75112676</tlogId>
<orgTlogID xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">7511243</orgTlogID>
<repeat xsi:type="xsd:int" xs:type="type:int">0</repeat>
<timeout xsi:type="xsd:int" xs:type="type:int">0</timeout>
<PAN xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5311694090467013</PAN>
<cardID xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2459709559338701</cardID>
<accNo xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1234567887654325</accNo>
<curBill xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">USD</curBill>
<avlBal xsi:type="xsd:double" xs:type="type:double">0</avlBal>
<blkAmt xsi:type="xsd:double" xs:type="type:double">0</blkAmt>
<localDate xsi:type="xsd:date" xs:type="type:date">2015-06-04</localDate>
<localTime xsi:type="xsd:long" xs:type="type:long">114918</localTime>
<amtTxn xsi:type="xsd:double" xs:type="type:double">5</amtTxn>
<curTxn xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">EUR</curTxn>
<billAmt xsi:type="xsd:double" xs:type="type:double">10</billAmt>
<billConvRate xsi:type="xsd:double" xs:type="type:double">2</billConvRate>
<amtCom xsi:type="xsd:double" xs:type="type:double">0</amtCom>
<amtPad xsi:type="xsd:double" xs:type="type:double">1</amtPad>
<txnCode xsi:type="xsd:int" xs:type="type:int">1</txnCode>
<termCode xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">12345679</termCode>
<crdAcptID xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Term1298</crdAcptID>
<crdAcptLoc xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Visa Europe~~London</crdAcptLoc>
<MCC xsi:type="xsd:int" xs:type="type:int">7995</MCC>
<poschp xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">2</poschp>
<poscdim xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">U</poscdim>
<poscham xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">9</poscham>
<poscp xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">0</poscp>
<approvalCode xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">96412</approvalCode>
<sysDate xsi:type="xsd:date" xs:type="type:date">2015-06-04</sysDate>
<rev xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</rev>
<itemSrc xsi:type="xsd:short" xs:type="type:short">0</itemSrc>
<orgItemId xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<crdproduct xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">O2CA</crdproduct>
<threeDSecChkRs xsi:type="soapenc:string" xs:type="type:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">U</threeDSecChkRs>
<ctxLocalDate xsi:type="xsd:date" xs:type="type:date">2015-06-04</ctxLocalDate>
<ctxLocalTime xsi:type="xsd:long" xs:type="type:long">172622</ctxLocalTime>
<amtFee xsi:type="soapenc:double" xs:type="type:double" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</amtFee>
<AVSChkRs xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">U</AVSChkRs>
<amtCashback xsi:type="xsd:double" xs:type="type:double">0.0</amtCashback>
<actionCode xsi:type="soapenc:string" xsi:nil="true" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
</pobjWSOutgoingTransactionRqstInfo>
</ns1:outgoingTransaction>
</soapenv:Body>
</soapenv:Envelope>

Saranya Jyothiramalingam

unread,
Sep 9, 2015, 3:15:00 AM9/9/15
to Gatling User Group
how to run this request in gatling scenario

Abhinav Gogna

unread,
Sep 9, 2015, 11:50:20 AM9/9/15
to Gatling User Group, sara...@wavecrest.gi
Steps:

1) Stick the response in a file and put it in request-bodies or bodies (depending on your gatling version)
2) Include the following header in httpProtocol 
val httpProtocol = http
  .baseURL("http://My-WS-Example/test")
  .contentTypeHeader("""application/xml;charset=UTF-8""")


3) use the following syntax in your scenario

val scn = scenario("Test-WS")
  .exec(http("Test-WS")
  .post("/")
  .body(ELFileBody("demo-WS/soap.xml"))
  .check(xpath("//totalResults/text()").find.not("0")))

  setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)


Also, you can parametrize the response (objects in file) with string interpolation (eg: "${myVar}") and use feeder for different variables.

Hope that helps

Saranya Jyothiramalingam

unread,
Sep 10, 2015, 8:16:09 AM9/10/15
to Gatling User Group
Thanks Abhinav,

I copied the particular auth request in gatling/request-bodies...And run the Gatling scenario.
This is my outgoing request and response..But how to validate the response.

 <complexType name="OutgoingTransactionRqstInfo">
    <sequence>
     <element name="messageID" type="xsd:int"/>
     <element name="instCode" type="soapenc:string"/>
     <element name="txnType" type="soapenc:string"/>
     <element name="msgType" type="xsd:int"/>
     <element name="tlogId" nillable="true" type="soapenc:string"/>
     <element name="orgTlogID" nillable="true" type="soapenc:string"/>
     <element name="repeat" nillable="true" type="xsd:int"/>
     <element name="timeout" nillable="true" type="xsd:int"/>
     <element name="PAN" nillable="true" type="soapenc:string"/>
     <element name="cardID" nillable="true" type="soapenc:string"/>
     <element name="accNo" nillable="true" type="soapenc:string"/>
     <element name="curBill" type="soapenc:string"/>
     <element name="avlBal" nillable="true" type="xsd:double"/>
     <element name="blkAmt" nillable="true" type="xsd:double"/>
     <element name="localDate" type="xsd:date"/>
     <element name="localTime" type="xsd:long"/>
     <element name="amtTxn" nillable="true" type="xsd:double"/>
     <element name="curTxn" nillable="true" type="soapenc:string"/>
     <element name="billAmt" nillable="true" type="xsd:double"/>
     <element name="billConvRate" nillable="true" type="xsd:double"/>
     <element name="amtCom" nillable="true" type="xsd:double"/>
     <element name="amtPad" nillable="true" type="xsd:double"/>
     <element name="txnCode" nillable="true" type="xsd:int"/>
     <element name="termCode" nillable="true" type="soapenc:string"/>
     <element name="crdAcptID" nillable="true" type="soapenc:string"/>
     <element name="crdAcptLoc" nillable="true" type="soapenc:string"/>
     <element name="MCC" nillable="true" type="xsd:int"/>
     <element name="poschp" nillable="true" type="soapenc:string"/>
     <element name="poscdim" nillable="true" type="soapenc:string"/>
     <element name="poscham" nillable="true" type="soapenc:string"/>
     <element name="poscp" nillable="true" type="soapenc:string"/>
     <element name="approvalCode" nillable="true" type="soapenc:string"/>
     <element name="sysDate" type="xsd:date"/>
     <element name="rev" nillable="true" type="soapenc:string"/>
     <element name="orgItemId" nillable="true" type="soapenc:string"/>
     <element name="itemSrc" nillable="true" type="xsd:short"/>
     <element name="amtFee" nillable="true" type="xsd:double"/>
     <element name="crdproduct" nillable="true" type="soapenc:string"/>
     <element name="ctxLocalDate" nillable="true" type="xsd:date"/>
     <element name="ctxLocalTime" nillable="true" type="xsd:long"/>
     <element name="aVSChkRs" nillable="true" type="soapenc:string"/>
     <element name="threeDSecChkRs" nillable="true" type="soapenc:string"/>
     <element name="actionCode" nillable="true" type="soapenc:string"/>
     <element name="amtCashback" nillable="true" type="xsd:double"/>
    </sequence>
   </complexType>
   <complexType name="OutgoingTransactionRspsInfo">
    <sequence>
     <element name="messageID" type="xsd:int"/>
     <element name="instCode" type="soapenc:string"/>
     <element name="txnType" type="soapenc:string"/>
     <element name="PAN" nillable="true" type="soapenc:string"/>
     <element name="cardID" nillable="true" type="soapenc:string"/>
     <element name="avlBal" nillable="true" type="xsd:double"/>
     <element name="blkAmt" nillable="true" type="xsd:double"/>
     <element name="approvalCode" nillable="true" type="soapenc:string"/>
     <element name="localDate" type="xsd:date"/>
     <element name="localTime" type="xsd:long"/>
     <element name="sysDate" nillable="true" type="xsd:date"/>
     <element name="actionCode" nillable="true" type="soapenc:string"/>
     <element name="curBill" nillable="true" type="soapenc:string"/>
     <element name="rev" nillable="true" type="soapenc:string"/>
     <element name="orgItemId" nillable="true" type="soapenc:string"/>
     <element name="itemSrc" nillable="true" type="xsd:short"/>
    </sequence>
   </complexType>
  </schema>

Saranya Jyothiramalingam

unread,
Sep 11, 2015, 7:19:55 AM9/11/15
to Gatling User Group, abhi...@gmail.com
Please help me....

How to add header for soapui request in gatling multiscenario file using scala language????

Error:no soapaction header error

What is the solution for that??


Abhinav Gogna

unread,
Sep 11, 2015, 8:49:29 AM9/11/15
to Gatling User Group, abhi...@gmail.com

http://www.w3schools.com/webservices/ws_soap_httpbinding.asp

.contentTypeHeader("""application/soap+xml; charset=utf-8""")

Reply all
Reply to author
Forward
0 new messages