Abhishek Yadav
Abhishek Yadav

Reputation: 362

How to make a soap client in Java?

I have gone through many answers on stack overflow on how to make a soap client in Java but i still can't wrap my head around it.

Requirements

1) I have been using loadrunner for making Soap requests but I am gonna discontinue the product and wanted to make a simple Java soap client.

2) I need to automate the soap client to test the web service every day and generate logs. There are gonna be 20-25 soap web services to be tested at a time. How can I achieve it?

3) I have gone through SAAJ and JAX-WS but I found them too complicated and to also couldn't figure out how can I head custom HTTP headers in the requests.

It seems like I am designing Loadrunner again. So my question is what can be the steps to achieve the above requirements.

I have a wsdl file, certificate, URL and some custom HTTP headers to be included in the request.

Also, should I use SOAPUI to generate the request xml first, would that be a better idea?

Upvotes: 0

Views: 675

Answers (1)

craigcaulfield
craigcaulfield

Reputation: 3538

As much as I love Java, if you have soapUI available, why reinvent the wheel by writing your own web service client? JAX-WS and SAAJ can do all the things you need; you just need to dig down into the APIs and experiment.

If it sounds like you're designing LoadRunner again, then why not stick with LoadRunner? It's free and integrates with soapUI, but like all tools it has a learning curve to be negotiated. There are alternatives such as Apache JMeter, but again it takes time to come up to speed.

Plus, LoadRunner might not be the right tool for your use case. If you just automating tests, and not performance or load testing, plain old soapUI used in conjunction with something like Jenkins might be a better alternative.

Upvotes: 1

Related Questions