Start Writing Web Services Today (cont.)

Deploying the Service
Apache Axis provides two means of deploying Web services: a hot deploy feature through the use of the .jws extension, and a less-elegant solution—XML deployment descriptors. Because of the serialization that our Web service requires, we have no option but to use the deployment descriptors. We need two XML files: One for deploying the service (deploy.wsdd) and one for undeploying the service (undeploy.wsdd). The complete deployment descriptor for our service can be found below:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <service name="WidgetConsumer" provider="java:RPC">
    <parameter name="className" value="WidgetConsumer"/>
    <parameter name="methodName" value="receiveWidget"/>
    <beanMapping qname="myNS:WGT" xmlns:myNS="urn:Widget"
               languageSpecificType="java:Widget"/>
  </service>
  
</deployment>
Rather than building the file from scratch, you can steal one from one of the sample applications that ships with Axis. If you do, then the boldface type indicates the data that should be changed. Also, it may be necessary to include the entire <beanMapping/> element because only one of the samples includes it.

The undeployment descriptor is significantly smaller. The entire file can be found below:

<undeployment xmlns="http://xml.apache.org/axis/wsdd/">
 <service name="WidgetConsumer"/>
</undeployment>
It simply uses the logical name of one or more services to indicate which services to undeploy.

With those two files created, we are ready to deploy and test the service. Be sure that all three files have been compiled and that the deployment descriptors are in the same directory as the class files. To deploy the service, issue the following command:

java org.apache.axis.client.AdminClient -llocal:///AdminService deploy.wsdd
You should see a message indicating that the descriptor has been successfully processed. To undeploy, run the same command but substitute the deploy.wsdd file for the undeploy.wsdd file. Then you may start up the WidgetFactory, passing in a color, shape, and numeric weight for a widget.

And there you have it. Congratulations!

Web Services Today and Tomorrow
Web Services represent a significant evolution in the areas of distributed computing and industry collaboration. Although they are just now beginning to move from the R&D phase and into production, they have already made a substantial impact upon the way we view software architecture, B2B collaboration, and system integration.

In the next few months, you'll begin to see Web service technologies incorporated into your corporate intranet and B2B extranets as businesses begin to realize the incredible savings in time, money, and headaches that these standards can provide. In the next year or two, Web services will become increasingly prevalent and begin to take on new dimensions. Applications will begin to consider contextual factors such as weather, geography, time of year, time of day, etc. when performing services on our behalf. Likewise, on-demand, Web service-like technologies will find their way into our cellular phones, PDAs, cars, and many other corners of our lives.

DevX Java Pro Kyle Gabhart is the director of the Java Technology Group for Objective Solutions, a Richardson, TX-based knowledge-transfer group specializing in Java technologies. He also serves as a senior mentor, trainer, and consultant for Objective Solutions, specializing in J2EE, XML, and Web Services technologies. Kyle can be reached at java@objectsoln.com..



Back to the Introduction


In this Article
Introduction A Complex Web Service
Web Service Examples Deploying the Service
A Simple Web Service Download the Code
 





FEATURE SOFTWARE:
dtSearch Web
Add power searching to your web site.
Buy Now!

Encrypt It
Encrypt and Decrypt Data, Passwords and Files within your application.
Buy Now!

Standards Organizations and Web Service Coalitions

Key Platforms

Pure-Play Web Services Vendors

Web Service Technologies or Components

From Sun.com

For Further Reading

Discussion Groups
Java Web Services
.NET Web Services

Back to the Special Report

Java Zone

2001 Special Report: Judging Java

TALK BACK
How do you intend to make your entry into Web services? What kinds of applications do you think you'll select first for web services deployment? Tell us in the Java Web Services newsgroup.


Sponsored Links

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers

Copyright Information/Privacy Statement