The Currency Converter Web service is used to convert one currency into another. This Web service accepts units of a particular currency and then converts them to another currency. This currency is then displayed as a result. The steps involved in the creation of the Currency Converter Web service are listed next:
We will now explain how to perform each of these steps.
Creating the Directory
You need to create a directory that will store the files of the Web service. To create a directory, perform the following steps:
The Main Interface of Sun ONE Studio.
The Explorer window is displayed as in Figure.
The Explorer Window
The New Wizard—Folder Dialog Box
The Explorer Window
Creating the Web Service
As discussed, the next step is to create the Web service. To do this, perform the following steps:
The Web Services Command on the New Submenu
The New Wizard—Web Service Dialog Box
The Explorer Window
Creating and Implementing the Class
The next step is to add the implementation class to the service. The class contains methods that will implement the logic of the tasks that the Web service will perform. Carry out the following steps to add the implementation method:
The Selection of the Empty Class Option
The Target Location Page
The Explorer Window Displays the Class that you Created
The Source Editor Window
The Class Name in the Explorer Window
The Output Window Shows the Compilation Result
Adding the XML Operation
Next, you need to add the XML operations to the Web service. The XML operation encapsulated the business method. It specifies how a request to the Web service will be processed.
The Selection of the XML Operation Command
The New Wizard—XML Operation Dialog Box
The Select Method Dialog Box
The Explorer Window Displays the XML Operation that you Added
Adding a Reference to the Web Service
The next step is to add a reference to the method and XML operations that you created for the Web service. To add the reference, you need to perform the following steps:
The Add Reference Dialog Box
Compiling the Java Files
You need to compile the Java files. You create some of these files, whereas Sun ONE Studio creates others. To compile the files, right-click CurrConvertService and then select Generate/ Compile Java File from the shortcut menu. The output window shows the result, as shown in Figure.
The Output Window
Adding a Client to the Web Service
The last step in developing the Web service is to create the client that will access the service. To create the client, perform the following steps:
The New Client Dialog Box
Executing the Web Service
Now that you have created the client, you're ready to execute the Web service. To execute the Web service, right-click CurrConvertService and then click the Execute command. The progress bar displays the progress, as shown in Figure.
The Progress Monitor
Running the Web Service
Sun ONE Studio automatically opens the browser and displays the client to you. You can now enter a value to convert and click the Invoke button to view the result, as shown in Figure.
The Web Browser
For example, if you enter 100 in the Pound text box and then click the Invoke button, the result is displayed in Figure.
The Result of the Currency Conversion
You have now learned how to create the Java Web service in the Sun ONE Studio IDE.
XML Related Interview Questions
|Soap Tool Interview Questions||HTML Interview Questions|
|PHP Interview Questions||ASP.NET Interview Questions|
|PHP5 Interview Questions||Java Interview Questions|
|CSS Interview Questions||XSLT Interview Questions|
|Java XML Interview Questions||XMLHttpRequest (XHR) Interview Questions|
|ebXML Interview Questions||XML DOM Interview Questions|
|XML-RPC Interview Questions||XSD Interview Questions|
|Soap Web Services Interview Questions||XSL Interview Questions|
|Xml Publisher Interview Questions|
Basics Of Xml
Basics Of Web Services
Introduction To Soap
Introduction To Uddi
Introduction To Wsdl
Creating A Web Service Using The Microsoft Soap Toolkit
Building Web Applications On The .net Platform
Creating An Asp.net Web Service
Creating A Web Service From An Interface
Introduction To The Atl Server
Creating A Web Service Using The Atl Server Library
Design And Creation Of The Knowledge Share Web Service
Introduction To Java Xml Technologies
Developing Java Web Services
Design And Creation Of A Web Service Using The Ibm Toolkit
Introduction To Mobile Applications
Creating A Mobile Application That Consumes A Web Service
Web Services Development With Jdeveloper
Creating Web Services Using Perl
Integration Of Xml Web Services With The Office Xp And Sql
Server 2000 Toolkits
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.