Blog

Using Eclipse Web Services Explorer for Testing and Explorig SOAP Web Services

The Web Services Explorer is a tool available within Eclipse and can be used to test SOAP web services. 

 

The Web Services Explorer primarily has below funtionalities:

  • Browsing and invoking Web services via their WSDL and XSD.

  • Biscovering Web services in WS-Inspection 1.0 documents, and in UDDI v2 or v3 registries using the UDDI v2 protocol.

  • Publishing Web services to UDDI v2 or v3 registries using the UDDI v2 protocol.

 

Using SOAP UI Tool for Testing SOAP Web Services

SoapUI is an open-source web service testing application for SOAP and REST web services.

Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing.

A commercial version, SoapUI Pro, which mainly focuses on features designed to enhance productivity, is also available. 

 

[Lab-Extras] Common Issues While Deploying JAX-WS RI Web Service in Apache Tomcat

Issue 1

java.lang.ClassNotFoundException:

     com.sun.xml.ws.transport.http.servlet.WSServletContextListener

 

Solution

Copy “jaxws-rt.jar” from JAX-WS RI zip (downloaded from https://jax-ws.java.net/) to Tomcat library folder “{$TOMCAT}/lib“.

 

Issue 2

Server startup failed and below errors were observed in logs:

SEVERE: A child container failed during start

[Lab] Developing Bottum-up SOAP Web Service in Tomcat Container using JAX-WS RI

We did not had to do any extra configurations for deploying our web service class in Glassfish server. This is because Java EE 5 and above compliant application servers such as Glassfish, comply to JSR 109 (Web services 1.2/1.3) and JSR 224 (JAX-WS 2.0/2.1/2.2).

Additional SOAP Binding Attributes and Attribute Combinations

The @SOAPBinding annotation can be used to configure the soap binding styles.

You can use the @SOAPBinding annotation on the SEI and any of its methods. The settings of the method’s annotation takes precedence.

 

The @SOAPBinding annotation has three attributes: Style, Use and ParameterStyle.

  • Values for style can be Style.DOCUMENT (Default) or Style.RPC.

  • Values for use are Use.Literal (Default) or Use.Encoded.

SOAP Binding Styles - DOCUMENT and RPC

SOAP Binding can be done using two styles: DOCUMENT and RPC. This is denoted in the wsdl as style in the binding section. 

The @SOAPBinding annotation can be used over an SEI (separate interface or class) to configure the soap binding styles, when developing a web service bottom up. Default is DOCUMENT. Annotate the SEI with @SOAPBinding(Style=Style.RPC) to get the RPC style. Generate a wsdl both with DOCUMENT and RPC styles and refer to them in parallel while going through these notes.

 

[Exercises] Additional Exercises based on SOAP Web Services

  1. Create a Web Service with a method that accept a String (as parameter) and Echo it back (return it).

    • Deploy the service on Glassfish application server

    • View and analyze the WSDL file and find the relationships with the class.

    • Test it using the Glassfish webservice tester

    • View and analyze SOAP request and SOAP response displayed by the tester.

[Lab-Analysis] Deploying a Bottum-up SOAP Web Service in Glassfish Server from Eclipse

We will quickly review the results of the lab @ http://javajee.com/lab-deploying-a-simple-soap-web-service-in-glassfish-....

 

The Web Service

We had deployed the below simple web service in Glassfish server using eclipse and all it took was to use an annotation @WebService to make it a web service. 

package com.javajee.webservices.soap;

[Lab] Deploying a Bottum-up SOAP Web Service in Glassfish Server from Eclipse

Prerequisites

Before trying out this example, you will need to download and install Java EE 7 SDK which comes with GlassFish Open Source Edition 4 (currently 4.1.1) and then configure eclipse to deploy Java EE applications directly to GlassFish Server.

For details, refer to http://www.javajee.com/configuring-glassfish-server-4-with-eclipse-to-bu....

 

Configuring Glassfish Server 4 with Eclipse to Build, Test, and Deploy Java EE 7 Applications

We will download and install Java EE 7 SDK which comes with GlassFish Open Source Edition 4 (currently 4.1.1)and then configure eclipse to deploy Java EE applications directly to GlassFish Server. You can download the latest Java EE 7 SDK from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. You can also directly download the latest commercially supported GlassFish Server distribution (currently 3.1.2.2) from the same link.

Pages

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!