[SSL] Using gatling to test SSL secured web service

522 views
Skip to first unread message

CHEN YANQING

unread,
Sep 14, 2015, 11:10:50 AM9/14/15
to Gatling User Group
Hello,

I'm having problem while running my test about a SSL secured web service.

I generated my certificates and installed them on a local tomcat server, tested it with SOAPUI, it worked correctly.

Now I'm trying to test it with gatling. But I always got the error when I run Engine:
---- Errors --------------------------------------------------------------------
> status.find.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 500

my configuration in gatling.conf as:
http {
    ssl {
      trustStore {
        file="mytruststore.truststore"
        password="password"
      }
      keyStore {
        file="mykeystore.keystore"
        password="password"
      }
    }

Here is my senario:
import io.gatling.core.Predef._
import io.gatling.core.scenario.Simulation
import io.gatling.core.session.Session
import io.gatling.http.Predef._
 
class SimpleTest extends Simulation {
 
  val httpProtocol = http
    .baseURL("https://localhost:8443/")
    .acceptHeader("text/html,text/xml,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3")
    .connectionHeader("Keep-Alive")
    .userAgentHeader("Apache-HttpClient/4.1.1 (java 1.5)")

  val scn = scenario("SimpleTest")
    .repeat(1) {
    exec(
      http("TestLocal")
        .post("services/mySimple_WS")
        .body(StringBody("""<my SOAP Request>"""))
         .header("Content-Type", """text/xml;charset=UTF-8""")
         .header("Accept-Encoding", """gzip, deflate""")
         .header("Connection", """keep-alive""")
    )
  }

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



Please help if you have any idea.

Regards,

CHEN YANQING

unread,
Sep 14, 2015, 11:13:20 AM9/14/15
to Gatling User Group
BTW
I'm using Version 2.2.0-M2

william wu

unread,
Sep 22, 2015, 8:34:38 AM9/22/15
to Gatling User Group
Hello,

Aren't suppose to set the SOAPAction in the header too ?


On Monday, September 14, 2015 at 5:10:50 PM UTC+2, CHEN YANQING wrote:

CHEN YANQING

unread,
Sep 29, 2015, 4:06:30 AM9/29/15
to Gatling User Group
it works with "RawfileBody"..

CHEN YANQING

unread,
Sep 29, 2015, 4:41:42 AM9/29/15
to Gatling User Group
Yes I set SOAPAction as well...

CHEN YANQING

unread,
Mar 13, 2016, 5:18:32 PM3/13/16
to gat...@googlegroups.com
Yes but it works now. Thx!
--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/3sPrBPni5x8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages