Automated testing of a SOAP Service - web-services

Before just answering: Use SoapUI. Please read the Question, because I tried SoapUI.
I have a lot big wsdl Files. Every Method works like this:
First do a synchronous Call:
Request: Please do foo and send Request to URI: XY
Response: Ok, your Job has UUID: abc
After the Job is done, my Sevice will respond to URI: XY, by sending only a request Message synchronously:
Request: Ok I finished your Job with the UUID: abc and the result is bar
We needed to use this behavior, because we have a pool where all answers will be stored and are identified by UUID.
Do you know a possibility to test such a SOAP Service?
I tried:
SOAP UI
BPEL Unit (I think it should be possible with BPEL Unit but I can't make it work properly)
Please don't recommend writing my own JAVA tests, because I have more than 100 methods to test.
Also the Tests need to be run and the results need to be analyzed automatically in a Test-suite, I can't do this for 100 Methods by hand everytime I change the code of the Web Service.

I'm one of the SoapUI Guys, so you'll probably HATE my answer...
But the solution is using SoapUI; more specifically using MockResponse TestSteps. SoapUI is NOT very strong when it comes to BPEL testing, but using MockResponse Steps you can fix it.
Look here: http://www.soapui.org/SOAP-and-WSDL/testing-asynchronous-services.html. Even though all calls are done synchronously, this can still be considered asynch testing since we have more than plain request/response.
I also know that Oracle has got a great write up on this.

What you need to do is to create a mock service that will receive the second call which signals that the job processing is done. This is can be done in SOAP UI, you can read about how to create a mock web-service here.

You can test Web Services by using Eclipse.
Just put the WSDL file on your project -> right click on the file -> web services -> test using web service explorer.
You will have an interface showing all your WSDL operations and fields which are needed.

Related

Test auto increment function of web service with simultaneous users

I have a web service that does a simple task of 'auto-incrementing' a simple field.I test it using SoapUI. That is, whenever I run SoapUI, the response would be a value that is one plus it's previous value. Now, the catch is, I want to test simultaneous users running the same web service. Meaning, if they all access the web service at once, the web service will respond with the correct incremented value.
For instance, I have 3 users who accessed the service at the same time. I am expecting that the response (integer value) they would get will not be the same with each other. It should be incremental. That's what I want to test.
I'm thinking of maybe incorporating JMeter and SoapUI, but I'm not sure if that's even possible. Do you have any suggestions on how I can handle this?
SoapUI offers some limited load testing capabilities so if you think the load from one machine will be enough and you will be happy with the load test metrics which reflect only average/min/max response times and throughput - you can conduct your load test using SoapUI only.
If you decide to go for JMeter - be aware that you can migrate your test in at least 2 ways:
Record running SoapUI test scenario using JMeter's HTTP(S) Test Script Recorder
Taurus automation framework comes with SoapUI xml to JMeter jmx converter.
If you want to do it manually check out Building a SOAP WebService Test Plan JMeter User Manual chapter
In order to "tell" JMeter to execute HTTP Request samplers with the desired amount of virtual users at exactly the same moment add Synchronizing Timer as a child of the relevant HTTP Request sampler.

SoapUI: Create mock service with pass-through behavior for selected methods

While developing a web application I have the following use case:
a 3rd party Web Service with quite a lot of methods is deployed on a test server A (with a single endpoint, e.g. http://3rdPartyServer/3rdPartySvc?WSDL)
a new method is about to be implemented in the near future, but I need to use it now
the rest of the methods are used throughout my code extensively
So I would like to do the following:
Create a mock service in SoapUI locally, based on the new WSDL which includes the new WS method (i.e. a superset of the WS methods currently on server A)
point my local application server to use the SoapUI mock service endpoint
mock only the response of the new WS method (create a dummy response for it in SoapUI)
let the other WS method calls to reach server A and return whatever it returns normally (i.e. use SoapUI as a proxy for these calls)
I've gone through the SoapUI documentation regarding service mocking and have used it numerous times, but could not find an option for such "pass-through" behavior.
When you read in your WSDL, the endpoint will point to your server.
Open your service, and select the service endpoint.
Add a second endpoint, to point to your mock. SoapUI has little bit of documentation showing this here. Only step "2. Getting Started" applies, not step 3!
In each of your tests, where you are using the mocked method, you will need to select the mock endpoint. Further discussion is here.

Send/Receive a SOAP request using SPRING JAVA

I am new to Spring web services. I am going to create an xml request, and send it as a SOAP request to a web service and receive the response.I read different documents but still confused as I could not find a working sample yet.
I know that I should use WebServiceTemplate and WebServiceMessageSender, SaajSoapmessageFactory (please let me know if I am wrong) but not sure how to use them.
Do I need WSDL? if yes why?
If you have any sample code please send me to get clear on it.
Thanks
If you want to send SOAP requests, you would like to be a SOAP client. Seems like you want to use spring-ws project. Check out their great documentation on the client side. The same documentation will guide you through the process of creating a server. There are plenty of examples and ready-made configuration snippets waiting for you.
Spring-WS is built on top of XML Schema description of your message, so you will need WSDL to generate e.g. JAXB models of your requests and responses.
AFAIK, for "web services" , the WSDL file is the machine blueprint of the "ports" as they are called However! ports in WSDL "means" java language(or any other programming language used with a routine or sub or procedure or function) method and has a specific naming scheme associate the .wsdl xml file(template of the service). Each WSDL port(language method) has specifications of return value and data specifications for how to feed it arguments and their type values.

Consuming SOAP web services without the add reference approach

I am looking to make a service agent in C# from scratch. If the contracts/XSD are shareable via WSDL or dll. How do I go about writing a light weight service agent that can be configured to make calls to the SOAP webservice. When you do an add reference I feel too much code is generated behind my back.
You can post data to a webservice using the following url structure:
http://mydomain.com/mywebservicedirectory/mywebservice.asmx/mywebservicemethod
Simply use an HTTP POST to pass data(typically xml/json) to the service and process the response.
I use a bassic soap template and XSLT to render it out for what I want. It isn't that fun if you need to call multiple methods. I'm simply calling the same method over and over so it's no big deal. Simple HTTP POST will do it, that's all WCF/ASMX does.
You can get the WSDL and use XSD.exe to generate the object classes for you.

Send XML file to Web Service using Java

I want to send an XML file to a Web Service.
The Web Service is a java application.
I know the endpoint of the Web Service.
Typically I know I have to create the request and send it as an http/https request.
What I want to know is what would I have to make to send the request - as in what development tool could I use e.g. Visual Web Developer (preffered as I am familiar with this) or Visual Studio? And what sends the request - e.g. another Web Service, a Website etc?
Where do I even begin with this?
Any comments are much appreciated.
Where do I even begin with this?
One purpose of a Webservice is loose coupling. So it depends on what you want to do. You can write a simple program in what ever language which constructs a request and sends it. You can write a Webservice on its own which uses the other Webservice to handle it's own requests.
You can handle this in a very simple or complex way. You only need to be able to generate a request (per xml) and send it.