Hi,
I am posting a soap request in gatling. Gatling Request is as below
package com.flexera.lfsperformance.scenarios
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class DeleteRequest extends Simulation {
val httpProtocol = http
.baseUrl("http://IP:PORT")
.inferHtmlResources()
.acceptEncodingHeader("gzip,deflate")
.contentTypeHeader("text/xml;charset=UTF-8")
.userAgentHeader("Apache-HttpClient/4.1.1 (java 1.5)")
val headers_0 = Map(
"Proxy-Connection" -> "Keep-Alive",
"SOAPAction" -> """""""")
val clientIdFeeder = Iterator.from(1).map(i => Map("id" -> "%03d".format(i)))
val scn = scenario("DELETE_REQUEST")
.repeat(10 ) {
feed(clientIdFeeder)
.exec(http("DeleteRequest")
.post("/ / / /")
.headers(headers_0)
.body(ElFileBody("DeleteRequest.dat"))
.basicAuth("username", "Password"))
}
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}
**Soap body is :**
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:v3.fne.webservices.operations.flexnet.com">
<soapenv:Header/>
<soapenv:Body>
<urn:deleteDeviceRequest>
<!--1 or more repetitions:-->
<urn:deviceIdentifier>
<urn:deviceType>${deviceType}</urn:deviceType>
<urn:deviceId>FNO${id}</urn:deviceId>
<urn:deviceIdType>${deviceIdType}</urn:deviceIdType>
<urn:publisherName>${publisherName}</urn:publisherName>
</urn:deviceIdentifier>
</urn:deleteDeviceRequest>
</soapenv:Body>
</soapenv:Envelope>
**The actual response we receive is :**
HTTP/1.1 200 OK
Expires: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Set-Cookie: JSESSIONID=wC2WtCaN9GITVdC3AE4sSFuZ.localhost; path=/flexnet; HttpOnly
Server: jboss
X-XSS-Protection: 1; mode=block
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Connection: keep-alive
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked
Content-Type: text/xml;charset=utf-8
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<soapenv:Body>
<deleteDeviceResponse xmlns="urn:v3.fne.webservices.operations.flexnet.com">
<statusInfo>
<status>**FAILURE**</status>
</statusInfo>
<failedData>
<failedDevice>
<deviceIdentifier>
<deviceType>CLIENT</deviceType>
<deviceId>FNO1</deviceId>
<deviceIdType>STRING</deviceIdType>
<publisherName>fnetest</publisherName>
</deviceIdentifier>
<reason>**LFSError_HOST_NOT_FOUND: Unable to find CLIENT host with unique keys [hostId=FNO1], [hostIdType=STRING], and [publisherName=fnetest] in tenant ADMN**.</reason>
</failedDevice>
</failedData>
</deleteDeviceResponse>
</soapenv:Body>
</soapenv:Envelope>
The actual response is FAILURE but, according to gatling since the status code is 200 OK all the requests are pass(OK). (Attached the gatling simulation graph)
Is there any way I can fail(KO) all the requets that has FAILURE in its response?