You are on page 1of 29

MyEclipse Learning Center > Web Services Development

MyEclipse Web Services Over

Table of Contents
1. Introduction
1. XFire Java SOAP Engine
2. Web Service Projects
1. Web Service Project Creation
2. Web Service Project Capabilities
3. Web Service Project Libraries
4. Web Service Project Preferences
3. Bottom-up (Code-First) Web Service Development
4. Top-down (WSDL-First) Web Service Development
1. WSDL Validation

2. WS-I Profile Validation


5. JAX-WS Annotation Support
6. WSDL Creation and Editing
7. Importing WSDL and WSIL Files
8. Web Service Client Development
9. Web Service Project Deployment and Debugging
1. Web Service Deployment Descriptor Editor
2. Web Service Debugging
10. Testing with the Web Service Explorer
11. Feedback

1. Introduction
Web services are increasingly seen as the core technology of the future for developing IT solutions capable of c
technology, OS and hosting environment, and intra-enterprise and inter-enterprise business domains. This doc
services development features which include tools for rapidly developing and testing web services and a light-
web services development features include:
• Top-down and bottom-up web service creation tools
• Web Service Explorer for testing web services
• WSDL creation, editing and validation tool, including JSR-181 WS annotations
• Web service project creation, configuration and validation
• Deploy web services to any Java servlet 2.4+ container
• Debug Java web service implementations

1.1 XFire Java SOAP Engine


MyEclipse web services tools are designed to work with the open-source XFire Java SOAP engine. XFire is one o
SOAP engines. Key XFire features include:
• Web Service standards: SOAP, WSDL, WS-I Basic Profile, WS-Addressing, WS-Security, JSR-181 WS annot
• Java-XML binding technology: Aegis, JAXB2 & 1, XMLBeans, Castor, and JIBX
• Multiple transport support: HTTP, JMS, XMPP, in-memory
• High performance SOAP stack

2. Web Services Projects


The first step in developing a web service is to create a MyEclipse web service project. This type of project is a
any servlet 2.4 or greater container. There are two methods for creating MyEclipse web service projects are de

2.1 Web Service Project Creation


The simplest way to create a web service project is to use the MyEclipse Web Service Project Wizard. See File>
Figure 2.1.1. Launching the Web Services Project Wizard
Figure 2.1.2. Project details page of the web services wizard
Figure 2.1.3. Deployment details page of the web services wizard
Figure 2.1.4. Library configuration page of the web services wizard

Figure 2.1.5. Package explorer view of a new web service project


Figure 2.1.6. View of web.xml configuration for a web services project

2.2 Web Services Project Capabilities


In addition to creating a Web Service Project directly, you can also enable any MyEclipse web project to host w
that project. The web service capabilities wizard is very similar to the web services project wizard and can be l
Web Services Capabilities... menu.
Figure 2.2.1. Launching the Web Service Capabilities Wizard

2.3 MyEclipse Web Service Library Management


MyEclipse-XFire libraries simplify the build-path management of XFire JARs. The libraries are organized around
XFire features that you wish to support with in your project by adding or removing the feature-specific MyEclip
Figure 2.3.1. MyEclipse XFire libraries that can be added to a web service project

2.4 Web Service Project Preferences


The MyEclipse web service preferences enable you to configure the JAR contents of the MyEclipse-XFire librarie
workbench menubar select Window > Preferences > MyEclipse > Project Capabilities > Web Services
Figure 2.4.1. Web services library preference page

3. Bottom-up (Code-First) Web Service Dev


The MyEclipse Web Service Wizard supports the bottom-up web service development process. This process con
creation of application business logic in the form of Java beans (POJOs) prior to defining the web service interfa
services from existing Java beans or will generate new Java beans if instructed.

Launch the web service wizard from the MyEclipse Java Enterprise perspective toolbar.

Figure 3.1. Launching the Web Service Wizard


Select the MyEclipse web service project in which the new web service will be created and the Bottom-up scen
Figure 3.2. Bottom-up page of web service wizard
Enter the new web service name and implementation details. Select Finish to create the web service.
Figure 3.3. Web service details page of the web service wizard
Upon completion the wizard has created the Java interface, IHelloWorldService, the Java class, HelloWorldServi
services.xml deployment descriptor.
Figure 3.4. Newly created web service and updated services.xml deployment descriptor

4. Top-Down (WSDL-First) Web Service Dev


The MyEclipse Web Service Wizard also supports the Top-down web service development process. This process
the definition of web service interfaces in the form of WSDL prior to the web service implementation.
Figure 4.1. Bottom-up page of web service wizard

Specify the WSDL file location, the Java-XML binding to generate, and the Java source folder and package wher
Finish to complete the wizard.
Figure 4.2. Web service details page of the web service wizard
Upon completion the wizard has added a <service> entry to the services.xml file and generated the Java-XML
interface, the HelloWorldServiceImpl class and the HellowWorldServiceClient class. Note that the project's com
greater as the generated Java code includes Java 5 - JSR-181 annotations.
Figure 4.3. Newly created Top-down web service

4.1 WSDL Validation


WSDL files used by the Top-down Service Wizard and the New Web Service Client wizard are now validated bef
and WS-I compliance are checked, giving you the opportunity to correct any mistakes before generating code.
Figure 4.1.1. WSDL validation results in Top-down web services wizard

4.2 Web Services Basic-I Profile Validation


Web Services Basic-I Profile (WS-I) is a web services interoperability standard that defines the technologies, the
common interoperable web service platform. MyEclipse web services tools can be enabled to validate web serv
specification.
Figure 4.2.1. WS-I validation configuration preferences

5. JAX-WS Annotation Support


MyEclipse enables the Java Editor to support JSR-181 annotations. The Java Editor will immediately recognize w
projects.
Figure 5.1. Code assistance with JSR-181 annotations in Java editor

6. WSDL Creation and Editing


The WSDL File Wizard will create a skeleton WSDL file. To launch the wizard, select File>New>Other>MyEcli
Figure 6.1. Launching WSDL Creation Wizard

Enter the namespace and select "Create WSDL Skeleton". Select Finish to complete the wizard and generate th
Figure 6.2. WSDL details page of WSDL Creation Wizard

Upon completion the skeleton WSDL file is created and opened in the MyEclipse XML editor for review and revi
Figure 6.3. WSDL Editor

7. Importing Web Services and WSIL Files


Use the MyEclipse Web Service Import Wizard to import WSDL and WSIL files into your project.
Figure 7.1. Launching the WSDL Import Wizard

8. Web Service Client Development


Convenient actions allow you to create a new Web Service client or a new Web Service directly from a WSDL fi
Figure 8.1. Launching the Web Services Client Wizard
Figure 8.2. Details page of Web service client wizard

9. Web Service Project Deployment and Deb


A MyEclipse web service project can be deployed to any J2EE 1.4 or Java EE 5 servlet container. During the dep
a project's web service resources and the XFire engine into a fully debuggable web archive (WAR). The deploy
web service project in both exploded archive form for development time debugging and in packaged archive fo
deployment service provides hot-sync update of all modified Java and web resources of a web service project t
Figure 9.1. Deployed web services project depicted in Servers

9.1 Web Service Deployment Descriptor Editor


The XFire framework is configured by services.xml deployment descriptor file. This file is a Spring beans XML c
customizations. The MyEclipse XFire Deployment Descriptor Editor extends the MyEclipse XML Editor with gram
an implicit special XFire DTD, custom code-assist for XML elements that define Java classes and interfaces.

Figure 9.1.1. Web Services Deployment Descriptor Editor


9.2 Web Service Debugging
Once deployed, standard MyEclipse web debugging facilities are available to all web services projects. These in
and JavaScript debugging.

Figure 9.2.1. Debugging a web service implementation

10. Testing with the Web Service Explorer


MyEclipse web services tools include the Web Service Explorer for dynamically interacting with local and remo
WSDL document that defines the web service interface. The Web Service Explorer reads a WSDL document for
generates a dynamic interface that allows you to send SOAP requests and view corresponding SOAP responses

Launch the Web Services Explorer from the MyEclipse perspective toolbar.

Figure 10.1. Launching the Web Services Explorer


Select the WSDL mode and enter the path to the WSDL file. In the example below we used the URL
http://localhost:8080/HelloWorld/services/HelloWorldService?WSDL.
Once the WSDL is retrieved the Web Service Explorer will present a list of end points. Below you can see the "e
parameter named in0. When the Go button is pressed, a SOAP request is constructed to invoke the "example"
the in0 parameter in the request. The result of the operation is displayed in the Status pane.
Figure 10.2. Exploring your web service

11. Feedback
We would like to hear from you! If you liked this overview, have some suggestions or even some corrections fo
about our learning material in our Documentation Forum. Please be sure to let us know which piece of MyEclip
quickly pinpoint any issues that arise.

You might also like