Skip to main content

Creating Bottom-up Web Service (WSDL)

This post will primarily show you how to create a simple Web Service application through Apache Axis in Eclipse, and will not dwell on explaining the background or functionality of a Web Service.

Yet, it’s a de facto to at least give a little definition.

WSDL or the Web Services Definition Language is just another specification to describe network XML-based services.
It supports message-oriented and procedural approach XML technologies. (for further reading click here)

1. Preparing the web application
a. Create a new web application and name it as “SimpleWebService”.

New Dynamic Project

b. Download and add “axis.jar” (download here) to the application libraries.
c. Edit and add this following configurations to the web.xml file.



< servlet >
< servlet-name >AxisServlet< / servlet-name >
< servlet-class >org.apache.axis.transport.http.AxisServlet
< / servlet-class >
< / servlet >
< servlet >
< servlet-name >AdminServlet< / servlet-name >
< servlet-class >org.apache.axis.transport.http.AdminServlet
< / servlet-class >
< load-on-startup >100< / load-on-startup >
< / servlet >
< servlet-mapping >
< servlet-name >AxisServlet< / servlet-name >
/servlet/AxisServlet< / url-pattern >
< / servlet-mapping >
< servlet-mapping >
< servlet-name >AxisServlet< / servlet-name >
< url-pattern >*.jws< / url-pattern >
< / servlet-mapping >
< servlet-mapping >
< servlet-name >AxisServlet< / servlet-name >
< url-pattern >/services/*< / url-pattern >
< / servlet-mapping >

*Note: spaces were created for display purposes only, adjust accordingly.


c. Create a public class and add any transactional method. In this sample i created “SimpleMessageTransport” method that accepts a string parameter and returns it to the server.

2. Creating Web Service


After successfully creating the artifacts of the Web application, it’s now time to create the Web Service.


a. From the file menu choose “New->Web Service”.
b. Configure exactly as shown in the picture below.

wsdl-conf


c. Then click Finish, it will then open a Web Service Client where you can verify and test.

wsdl-generated


Your project structure should look like this

project-struc


Voila! you can now access your Web Service through the net!.

local-access

Comments

Popular posts from this blog

Prototype, Dojo, Script.aculo.us (JavaScript Framework)

These three famous Javascript frameworks are certainly in the top list of every web developer. They are a proven help in developing dynamic and creative web portals. Without their birth, how in the earth “google” could produce a fanstatic portal such as “igoogle” ( hhmmmm have you thought of it? ). Now, if you are just starting to explore the usage and advantages of either of these frameworks, let me give you a little hint of the best tool to use in your application (*wink). Advantages … 1. AJAX Function All of these frameworks enable you to deal with AJAX with ease and they are also cross-browser compliant. Besides simple requests, they also provide various ways to handle the response from the server, either through XML, JSON or plain text. My advise here, if you only need a way to use AJAX functions and customized UIs is not a concern, use the primitive framework – prototype. Prototype is the best tool to use as it is just a one file function compared to the other two custo...

Reviewing the BASICS

Right knowledge in OOP makes your code and implementation more reliable. This can be achieved by correct coding practice and methodology. However, there will come a time that you’ll be affront with confusion of concepts and implementation of what OOP objects to use in right and efficient way. You’ll be stuck if you’re not well equipped. In this article, I’m hoping to aid newbies in this context, familiarize you with the basics of OOP that i think you need to know to get all throughout a smooth coding spree. Here are some common discussions found in development forums that you might find useful resource. Static vs Non-Static Static members : Act like global variables. There is only one instance of it in the entire program execution. They can be used with the class name directly and shared by all objects of a class. Example on referring a static method or data member. class A { static int firstInt; static int secondInt; static void i...