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 ?
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://184.108.40.206: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?
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.
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