Я пытаюсь отобразить рабочий запрос мыла на Gatling, кажется очень простым, но я продолжаю получать 400 ошибок в Gatling, тогда как я получаю 200 OK в SOAP UI
Вот подробности SOAP UI: -
Raw-->
POST 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"
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/"
xmlns:ns="http://www.ds.com/Service/2013-03">
<soapenv:Header/>
<soapenv:Body>
<ns:GetAccountVersion>
<!--Optional:-->
<ns:request>
<ns:UserName>?</ns:UserName>
</ns:request>
</ns:GetAccountVersion>
</soapenv:Body>
</soapenv:Envelope>
Теперь эквивалентный код Гатлинга: - имитация пакета
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")
val header = Map(
"POST" -> "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",
"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/"
xmlns:ns="http://www.ds.com/Service/2013-03">
| <soapenv:Header/>
| <soapenv:Body>
| <ns:GetAccountVersion>
| <!--Optional:-->
| <ns:request>
| <ns:UserName>?</ns:UserName>
| </ns:request>
| </ns:GetAccountVersion>
| </soapenv:Body>
|</soapenv:Envelope>""")))
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
Пожалуйста, обратите внимание, что эта служба не требует аутентификации, но Гатлинг все равно выбрасывает 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
---- Errors --------------------------------------------------------------
------
> status.find.in(200,304,201,202,203,204,205,206,207,208,209), b 1
(100.0%)
but actually found 400