Unanswered question

Web Service with json request

I want to create a test for a web service, using json as a request, I noticed that there is a xml section and import a WSDL, but I don't know how to use with json format

Kevin H.
Kevin H.

Kevin H.

Level
0
15 / 100
points

Answers

The WSDL import feature will create you a SOAP request content in an XML format. You can still start from there if you have a WSDL definition file but you can also manually create a POST request in NeoLoad using Text content mode and put your JSON content inside that request.

If you need to add some headers you can also add them in that request.

Kevin H.
Kevin H.

Kevin H.

Level
0
15 / 100
points

The problem is that I don't have WSDL definition file. To consume the web service I use Chrome Postman, with an url, no headers and json body, works fine, but I don't know how to translate that to NeoLoad.

Joao R.
Joao R.

Joao R.

Level
0
21 / 100
points

I have exactly this problem. I want to create a test for this post:

POST /session HTTP/1.1
Host: localhost
Content-Type: application/json
Cache-Control: no-cache

{ "username":"user1", "password":"1234" }

And I am not able to do this by NeoLoad, or am I?

Christophe M.
Christophe M.

Christophe M.

Level
0
22 / 100
points

WSDL is there for SOAP-based web services only.
When dealing with JSON you have to create a new request by hand:

1. Click on a page (mandatory container), you can create a new one. (if you want to play the requests under the page sequentially and not in parallel ensure the appropriate settings is used with "Advanced..." on the page).
2. Righ-Click "Insert as child / Http Request"
3. Edit The request:

  • "POST" as method and use « Text » for Post Content type
  • Edit server and Path
  • add your Content in the TextArea
  • Add headers: "Advanced..." / "Request headers" and set "Content-Type: application/json".

Joao R.
Joao R.

Joao R.

Level
0
21 / 100
points

It worked!
Thanks, Christophe M.