# SOAP calls

**URL:** <https://community.gatling.io/t/soap-calls/1901>\
**Category:** Gatling (Open-Source)\
**Created:** [January 14, 2015, 2:06pm UTC](https://community.gatling.io/t/soap-calls/1901 "2015-01-14T14:06:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aram](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Aram](https://community.gatling.io/u/Aram)\
**Post date:** [January 14, 2015, 2:06pm UTC](https://community.gatling.io/t/soap-calls/1901/1 "2015-01-14T14:06:39Z")

</div>

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

class Rutger extends Simulation {

val httpProtocol = http  
.baseURL(“[http://webpage](http://webpage)”)  
.acceptHeader(“text/html,text/xml,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
.acceptEncodingHeader(“gzip, deflate”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.connection(“keep-alive”)

val Test = scenario(“Rutger”)  
.exec(http(“Call”)  
.post("/")  
.body(StringBody("\<soapenv:Envelope xmlns:soapenv=“[http://test.com](http://test.com)” xmlns:req=“[http://test.comt](http://test.comt)” xmlns:com=“[http://test.com](http://test.com)” xmlns:ser=“[http://test.com](http://test.com)”\>  
soapenv:Header/  
soapenv:Body  
req:GetVersionRequest  
\</req:GetVersionRequest\>  
\</soapenv:Body\>  
\</soapenv:Envelope\>"))  
.check(regex(“Envelope xmlns”))  
.check(status.is(200)))

setUp(Test.inject(atOnceUsers(1))).protocols(httpProtocol)  
}

Hello everybody,

this works perfectly, but how dow I integrate

val User = “WebServiceTest1”

val Password = “WebServiceTest1”

with basicAuth() ?

and how can you integrate an wsdl file in your scenario?

Tnx

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 14, 2015, 2:12pm UTC](https://community.gatling.io/t/soap-calls/1901/2 "2015-01-14T14:12:44Z")

</div>

> how dow I integrate
> 
> val User = “WebServiceTest1”
> 
> val Password = “WebServiceTest1”
> 
> with basicAuth() ?

[http://gatling.io/docs/2.1.3/http/http\_protocol.html#authentication](http://gatling.io/docs/2.1.3/http/http_protocol.html#authentication)

> and how can you integrate an wsdl file in your scenario?

Not supported. Use SoapUI for generating a body template (which you probably already do).

---

<div class="post-metadata">

**Author:** ![Aram](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Aram](https://community.gatling.io/u/Aram)\
**Post date:** [January 14, 2015, 2:23pm UTC](https://community.gatling.io/t/soap-calls/1901/3 "2015-01-14T14:23:45Z")

</div>

We really do not want to use SOAPUI, because we like Gatling.

So is there a way to work around the wsdl aspect and integrate it as an:

- bodyPart
- ELfileBody
- Or as an URL

Tnx Stephane

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 14, 2015, 2:29pm UTC](https://community.gatling.io/t/soap-calls/1901/4 "2015-01-14T14:29:03Z")

</div>

What I meant with SoapUI was just use it to reverse engineer the WSDL into a SOAP sample and paste it into a StringBody or a ELfileBody.  
As of now, we don’t have our own WSDL reverse engineering tool. And that’s something that has to happen prior to running the simulation as you’ll want to edit it in order to add some EL placeholders.

Does this solution suites you? Or do you have something else in mind?

---

<div class="post-metadata">

**Author:** ![Aram](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Aram](https://community.gatling.io/u/Aram)\
**Post date:** [January 14, 2015, 2:34pm UTC](https://community.gatling.io/t/soap-calls/1901/5 "2015-01-14T14:34:57Z")

</div>

One thing…

…your the man!!

Thank you

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 14, 2015, 2:38pm UTC](https://community.gatling.io/t/soap-calls/1901/6 "2015-01-14T14:38:21Z")

</div>

You’re welcome 🙂

---

<div class="post-metadata">

**Author:** ![Gatling\_Newbie](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Gatling\_Newbie](https://community.gatling.io/u/Gatling_Newbie)\
**Post date:** [April 16, 2017, 9:10am UTC](https://community.gatling.io/t/soap-calls/1901/7 "2017-04-16T09:10:40Z")

</div>

Hi Aram/Steph,

I am quite new to gatling and scala.

I have a WSDL and a request XML and generally use SOAP UI to get the response.

Now, I want to use gatling to call the same web service to scale its performance in case concurrent users are accessing the same…

I tried to use below program (from Aram) and, but getting compilation errors like this. Can you please help me in resolving these?

GATLING\_HOME is set to “C:\Users\MyID\gatling-charts-highcharts-bundle-2.2.4”  
JAVA = “java”  
14:26:01.481 [ERROR] i.g.c.ZincCompiler$ - C:\Users\MyID\gatling-charts-highcharts-bundle-2.2.4\user-files\simulations\Sample\_Gatling\getQuote.scala:22: unclosed string literal  
14:26:01.483 [ERROR] i.g.c.ZincCompiler$ - \</soapenv:Envelope\>"))  
14:26:01.483 [ERROR] i.g.c.ZincCompiler$ - ^  
14:26:01.492 [ERROR] i.g.c.ZincCompiler$ - C:\Users\MyID\gatling-charts-highcharts-bundle-2.2.4\user-files\simulations\Sample\_Gatling\getQuote.scala:17: identifier expected but $XMLSTART$\< found.  
14:26:01.492 [ERROR] i.g.c.ZincCompiler$ - soapenv:Header/  
14:26:01.492 [ERROR] i.g.c.ZincCompiler$ - ^  
14:26:01.492 [ERROR] i.g.c.ZincCompiler$ - C:\Users\MyID\gatling-charts-highcharts-bundle-2.2.4\user-files\simulations\Sample\_Gatling\getExpectedAmount.scala:27: ‘)’ expected but ‘}’ found.  
14:26:01.492 [ERROR] i.g.c.ZincCompiler$ - }  
14:26:01.493 [ERROR] i.g.c.ZincCompiler$ - ^  
14:26:01.496 [ERROR] i.g.c.ZincCompiler$ - three errors found  
14:26:01.498 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed  
sbt.compiler.CompileFailed: null

Thanks  
Praveen
