Hi Kawthar,

Axis is a servlet or server in your case.

The way to use web services in general is to have a normal java application 
that exposes services via an interface. These are just plain old java objects. 
Once you have an interface you can the run java2WSDL against the interface to 
generate a WSDL file that describes your service.

Once you have the WSDL you can then use WSDL2java to produce all or your server 
classes, your [un]deploy.wsdd and a whole host of serializable objects and 
Exceptions (if your service throws them).

If you have already implemented your service i.e. it runs but not currently as 
a web service you will want to tell WSDL2java not to generate the server side 
Stub. This will then create an Imple class that will also be the deployed 
service class in the [un]deploy.wsdd. 

In the stubbed methods of this class you can defer all the calls to your 
implementation. The signatures of the methods should be identicle to those 
defined in your oridinal interface.

As you will already have a fully functional service just not as a web service 
all of the created serializable classes and exception created by WSDL2java can 
be thrown away and you can just keep the originaly implemented objects.

Now you should have a deployable web service. Use the Axis Admin Service to 
deploy your web service and hey presto....

To retrieve the request that was made to invoke your service you use the Axis 
MessageContext to aquire the ServletContext from which you can then get the 
original Servlet Request and from there all of the parameters passed.

here is an example of how to aquire the ServletContext from within a method in 
the deployed Impl class.

org.apache.axis.MessageContext axisContext = 
org.apache.axis.MessageContext.getCurrentContext();
javax.servlet.ServletContext sc = ((javax.servlet.http.HttpServlet)
axisContext.getProperty
(org.apache.axis.transport.http.HTTPConstants.MC_HTTP_SERVLET)).getServletContex
t();

Hope this helps you out and gets you on the road to creating some useful web 
services in the future.

Regards

Steve



Quoting Kawthar Bt M Sulaiman <[EMAIL PROTECTED]>:

> 
> How do I retrieve SOAP message from HttpServletRequest?
> Do I need to use request.getParameter("???")?
> 
> I'm trying to implement a server.  This is what I've done:
> 
> 1.  I have deploy.wsdd file and was able to see it under AxisServlet.
>      I'm still not 100% clear what this does?  Does it only creates a
> wsdl file?
>      It doesn't create the stub classes, does it??
> 
> 2.  I have MOService.class, which has one method:
>         public String deliverMOMessage(int appId, String msisdn, ....)
> 
> 3.  I have MOServlet.class.  Inside the doPost(), I need to retrieve
> the
>      SOAP message from request object and retrieve all the params. 
> Then
>     I can invoke MOService service = new MOService();
>                         service.deliverMOMesasge(<params>).
> 
> Is this how you implement a server??  Most of the samples I found
> implement
> client.. so I'm not so sure how the server works (with servlet).
> 
> Thanks,
> --Kawthar
> 
> Confidential information may be contained in this e-mail and any files
> transmitted with it ('Message'). If you are not the addressee indicated in
> this Message (or responsible for delivery of this Message to such person),
> you are hereby notified that any dissemination, distribution, printing or
> copying of this Message or any part thereof is strictly prohibited. In such a
> case, you should delete this Message immediately and advise the sender by
> return e-mail. Opinions, conclusions and other information in this Message
> that do not relate to the official business of Maxis shall be understood as
> neither given nor endorsed by Maxis.
> 




---------------------------------------------------
This message was sent using Spansurf Web Mail
Internet access in Spain - http://www.spansurf.com/

Reply via email to