Testing the SOAP web services:
To test the created or hosted web service in the SOAP UI we need to do the fallowing steps:
1. In the SOAP UI, give right click on the Projects and create your own project.
2. Add the wsdl to the project by giving the right click on the created project.
In the fallowing screen shot shows the project creation with the loaded wsdl.
3. Now unwrap the loaded wsdl and you can find the Request1 in that, give a double click on
that.
4. Now you can see the request elements in the worksheet of the SOAP UI as shown below
5. Now we have to add the endpoint url to the address bar, which can find the service where its hosted.
Read: Creating SOAP Web Services using JAX-WS
6. Now click on the Run option and see the response on the right side of the SOAP UI worksheet as shown below.
This is one of the way we can test the SOAP web services using SOAP UI.
For a request we can see the response .
In the above example, I have a request of findAirportNames, where countryCode passed as arg0 that is 'IN', and we got the response for that saying the Airport name and the city name.
This is the info shown which is available for that service, now if we pass some invalid info in the request that is also must be handled in the web services. That we can achieve using web services faults.
If the request is triggered with an invalid info that time the request and response could be as shown in the example:
Related posts:
Creating SOAP Web Services using JAX-WS
Difference between SOAP and REST web services
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String
No comments:
Post a Comment