# Getting 400 response in Gatling After Mapping whereas  same service works correctly in SOAP UI

**URL:** <https://community.gatling.io/t/getting-400-response-in-gatling-after-mapping-whereas-same-service-works-correctly-in-soap-ui/4990>\
**Category:** Gatling (Open-Source)\
**Created:** [May 1, 2019, 12:44am UTC](https://community.gatling.io/t/getting-400-response-in-gatling-after-mapping-whereas-same-service-works-correctly-in-soap-ui/4990 "2019-05-01T00:44:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarun\_Das](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tarun\_Das](https://community.gatling.io/u/Tarun_Das)\
**Post date:** [May 1, 2019, 12:44am UTC](https://community.gatling.io/t/getting-400-response-in-gatling-after-mapping-whereas-same-service-works-correctly-in-soap-ui/4990/1 "2019-05-01T00:44:00Z")

</div>

Hi Team,

I am trying to map a working soap request to Gatling seems very basic but i keep getting 400 error in Gatling whereas i am getting 200 OK in SOAP UI

Here is SOAP UI details :-

Raw–\>  
POST [http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2](http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2) HTTP/1.1  
Accept-Encoding: gzip,deflate  
Content-Type: text/xml;charset=UTF-8  
SOAPAction: “[http://www.ds.com/Service/2013-03/IEventReporterEndpoint/GetAccountVersion](http://www.ds.com/Service/2013-03/IEventReporterEndpoint/GetAccountVersion)”  
Content-Length: 385  
Host: r20services.onlinegaming.local:4059  
Connection: Keep-Alive  
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

XML–\>  
\<soapenv:Envelope xmlns:soapenv=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)” xmlns:ns=“[http://www.ds.com/Service/2013-03](http://www.ds.com/Service/2013-03)”\>  
soapenv:Header/  
soapenv:Body  
ns:GetAccountVersion

ns:request  
ns:UserName?\</ns:UserName\>  
\</ns:request\>  
\</ns:GetAccountVersion\>  
\</soapenv:Body\>  
\</soapenv:Envelope\>

Now the equivalent Gatling code is :-

package simulations

import baseConfig.BaseSimulation  
import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_

import scala.language.postfixOps

class ERBSGetServiceVersion extends BaseSimulation {

val httpProtocol = http  
.baseURL(“[http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2](http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2)”)

val header = Map(  
“POST” → “[http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2](http://r21sVCS.onlinegaming.local:4059/Business/EventReporterV2) HTTP/1.1”,  
“Accept-Encoding” → “gzip,deflate”,  
“Content-Type” → “text/xml;charset=UTF-8”,  
“SOAPAction” → “[http://www.ds.com/Service/2013-03/IEventReporterEndpoint/GetAccountVersion](http://www.ds.com/Service/2013-03/IEventReporterEndpoint/GetAccountVersion)”,  
“Content-Length” → “385”,  
“Host” → “r21sVCS.onlinegaming.local:4059”,  
“Connection” → “Keep-Alive”,  
“User-Agent” → “Apache-HttpClient/4.1.1 (java 1.5)”  
)

val scn = scenario(“SOAPRecordedSimulation”)  
.exec(http(“Get Service Soap Request”)  
.post(" HTTP/1.1")  
.headers(header)  
.body(StringBody(“”"\<soapenv:Envelope xmlns:soapenv=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)” xmlns:ns=“[http://www.ds.com/Service/2013-03](http://www.ds.com/Service/2013-03)”\>

> soapenv:Header/  
> soapenv:Body  
> ns:GetAccountVersion
> 
> ns:request  
> ns:UserName?\</ns:UserName\>  
> \</ns:request\>  
> \</ns:GetAccountVersion\>  
> \</soapenv:Body\>  
> \</soapenv:Envelope\>“”")))  
> setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)

}

Kindly Note this service doesnt requires authentication but still Gatling throws 400

17:11:56.245 [WARN] i.g.h.a.ResponseProcessor - Request ‘Get Service Soap Request’ failed: status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400

---

<div class="post-metadata">

**Author:** ![James\_Warr](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@James\_Warr](https://community.gatling.io/u/James_Warr)\
**Post date:** [May 1, 2019, 5:13am UTC](https://community.gatling.io/t/getting-400-response-in-gatling-after-mapping-whereas-same-service-works-correctly-in-soap-ui/4990/2 "2019-05-01T05:13:34Z")

</div>

I think you’ll need to .stripMargin on your request’s StringBody - I don’t think your xml parser will like the pipes
