File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes WSDD - Apache axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDD - Apache axis" Watch "WSDD - Apache axis" New topic
Author

WSDD - Apache axis

Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
How to write an customized deployment descriptor (wsdd) file ? I'm using apache axis.
At present i'm using
<service name="SomeService" provider="java:RPC">
<parameter name="allowedMethods" value="oneMethod"/>
<parameter name="className" value="com.HelloWorld"/>
</service> to specify a service


The automatically generated WSDL file appear something like this

<wsdl:message name="oneMethodRequest">
<wsdl art name="in0" type="xsd:string" />
</wsdl:message>

Its uses it own parameter naming convention like in0, in1 etc., Instead i would like them to appear as inputName, inputAge etc.,
I would also like to add some comment at the top of wsdl file.

is it possible to specify them in wsdd file itself ? Any guidelines ?


Spritle Software Blogs
Rich Raposa
Ranch Hand

Joined: Dec 06, 2001
Posts: 46
When you compile your source code, turn debugging on. Apache will use your parameter names in the WSDL file.


Rich Raposa<br /><a href="http://www.javalicense.com" target="_blank" rel="nofollow">http://www.javalicense.com</a><br />Buy Java courseware -> get a free XBox!
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Rich Raposa:
When you compile your source code, turn debugging on. Apache will use your parameter names in the WSDL file.

Hello Rich,
Could you please explain a bit more. I don't know which source code you mean here ?
balaji
Cory Wilkerson
Ranch Hand

Joined: Aug 14, 2001
Posts: 84
I think you're wsdd file looks fine so long as you've got a class residing on the server side "HelloWorld" in package "com" with a method named "oneMethod" -- but, I'm not sure how you're "automatically" generating wsdl from the wsdd file -- I didn't know that was a possibility with axis.
I believe Rich is suggesting that you use some of the axis tools to create wsdl for you from your java source, ie, java2wsdl.
Have a look here: http://12.230.201.166:8080/axis/docs/reference.html. (This could be an out of date ref, but does show the switch).
On a related note -- can anyone comment on how to create WSDL for message based services, ie, whose server side class is working with the actual XML?
Rich Raposa
Ranch Hand

Joined: Dec 06, 2001
Posts: 46
Balaji,
That was my mistake. I forgot there is no compiling when you place a .java file in the \axis folder and rename it with the .jws extension.
What Cory said is correct: If you want the WSDL to use your paramater names, then you need to compile the source code yourself, making sure debugging is turned on.
javac -g Calculator.java
Then use the java2wsdl tool that comes with Axis. For example, if AXIS_HOME is an environment variable equal to the install directory of Axis, then the following two commands should do it:

set CLASSPATH=.;%AXIS_HOME%\lib\axis.jar;%AXIS_HOME%\lib\wsdl4j.jar;%AXIS_HOME%\lib\commons-logging.jar;%AXIS_HOME%\lib\saaj.jar;%AXIS_HOME%\lib\jaxrpc.jar;%AXIS_HOME%\lib\tt-bytecode.jar;
java org.apache.axis.wsdl.Java2WSDL -o calculator.wsdl -l
"http://localhost:8080/axis/Calculator.jws" Calculator
The -o option is for the name of the output file, and the -l option is URL of the service.
Let me know if that works.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hello Rich and Cory,
Sorry for my delayed reply.thanks a lot replying.
Yes I compiled with javac -g option and now i can able to see my own input parameters in the auto generated wsdl
Actually I'm not using jws, i create class, place them in web-inf/classes directory and deploy them with org.apache.axis.AdminClient tool where i supply my wsdd file.
I'm also not using Java2WSDL, i using the web based admin interface of Axis, where services deployed were listed with link to WSDL generation.
Thanks for replying.
Regards
Balaji
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Cory Wilkerson:

On a related note -- can anyone comment on how to create WSDL for message based services, ie, whose server side class is working with the actual XML?

I hope you know this now.
Auto generation of WSDL
Two option:
1. read this link http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/docs/user-guide.html#Java2WSDL: Building WSDL from Java
2. or After deploying ur service using AdminClient, go to http://localhost/axis/servlet/AxisServlet you will see all ur services listed with a link to auto WSDL generation(auto).. here i assume that u had hosted ur axis under webapps/axis directory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSDD - Apache axis