Hi Pricilla,

I'll answer you to the best of my knowledge, which is limited to how I've
used Axis so far.

The file with the word "Skeleton" in it is the only file that you should
have to modify.  The java class that you created in the first steps (to come
up with the WSDL file) probably only contained the signatures of your web
service methods.  The Skeleton file is pretty much the equivalent of your
.java file, e.g. it only contains method signatures, but it uses SOAP object
types instead of the types that you used.

Look for your method names in the skeleton file.  There should be a comment
for each of them telling you that you need to implement them (along with a
thrown exception).  In other words, for each of your methods, remove
everything between the opening and closing braces, and start coding.

The WSDL2Java process should have also created a build.xml file.  Once your
Skeleton is coded, you can right-click this build file, and choose "Run
as...", and then "Ant Build".  This will compile your classes (skeleton
included), and create the .class files and a .aar file in the "build"
sub-directory of your project (which it will create).

The .aar file is the archive that you need to deploy to a container. 
Personnally, I use Tomcat, and so that's what I'll talk to you about.

First, you need to download and install Tomcat.  Once tomcat is installed,
you need to download and install the Axis2 War Archive FOR THE SAME VERSION
OF AXIS2 THAT YOU USED TO CREATE YOUR WEB SERVICE.  

To install the .war file, you have two options : copy it to the
<TOMCAT_HOME>/webapps directory (and restart tomcat just to make sure), or
use the "Tomcat Manager" application that comes with Tomcat.  I'll let you
search a bit for that...

Once Axis2 is installed, you can access it by going to
http://<server>:8080/axis2.  Three options will be offered there : Services,
Validate, and Admin.  You can validate your Axis2 installation with the
Validate option.

To deploy your service, again, you have two options.  1- drop your .aar file
in the <TOMCAT_HOME>/webapps/axis2/WEB-INF/services directory, or use the
deployment tool in the Admin section of axis2 (user/pass is admin/axis2). 
The deployment tool is the first option in the Admin section.

For development, I also recommend editing the
<TOMCAT_HOME>/webapps/axis2/WEB-INF/conf/axis2.xml configuration file.  The
line to edit is has "hotupdate" in it, you should set this parameter to
true.  This will make Axis re-deploy your web service every time you
overwrite the .aar file with a new one.

As for the stub, don't touch it.  It was created by WSDL2Java to match the
method signatures of your web service.  What you need to do in your client
is instantiate it, and call its methods.  It will take care of communicating
with your web service and returning you the result.

Here's a sample of my code that uses my stub.  This is the more complex
asynchronous call, for which you need to create a callback object.  The more
direct synchronous call is more intuitive... :

Dispatch request = new Dispatch();
DispatcherStub stub = new DispatcherStub("http://"; + dispatcherHost +
":8080/axis2/services/Dispatcher");
Callback callback = new Callback();
callback.setId(obj.getId());
request.setId(obj.getId());
stub.startdispatch(request, callback);

I'm sure I forgot a detail or two, but that's the essence of it.


pricilla p wrote:
> 
> Hi Jacques,
> 
> I am new to axis.
> 
> I have to develop an web service
> 
> I have followed the steps you mentioned and created a wsdl, skeleton and
> stubs.
> 
> Could you pls tell me what changes i need to make it in skeleton and stub
> files
> 
> Also pls tell me how to deploy this web service.
> 
> 
> Thanks,
> Pricilla.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WSDL2JAVA-created-uncompilable-Stub-tp17775033p22927751.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to