Forums Register Login

wsdl

+Pie Number of slices to send: Send
new to web service. when developing a web service application, usually how do we come up with a wsdl file ? do we usually first write a java code then convert it to wsdl using tool or what ? does it make sense to create a wsdl first without using any java code ? -- assuming I am using java lang for WS.
+Pie Number of slices to send: Send
It is always a good practice to start with WSDL first to make sure that your WSDL is more interoperable.
+Pie Number of slices to send: Send
Hi!
I remember when I started looking at SOAP web services and WSDLs. At that time, I thought WSDLs were slightly frightening and difficult to grasp.
Despite the experience I have gained, I still do not sit down and write a WSDL document from scratch, so I am going to suggest a slightly more convenient approach to WSDL-first web service development. I call this method "WSDL first with Some Java in the Beginning".
- Write a Java class representing the endpoint implementation class, but that only contains empty methods, that is, methods with no code (except for perhaps returning null or zero values as the result of the methods).
This class is to be annotated with all the appropriate web service annotations.
- If any bean classes are needed to pass information to, or return information from, methods in the class in the previous step then implement these.
- Use wsgen to generate a WSDL document from the Java class in the previous step.
- Manually edit the generated WSDL document and customize it as desired.
- Use the WS-I Basic Profile tool to verify that the WSDL complies with the WS-I Basic Profile.
This tool can be downloaded freely from: http://www.ws-i.org/deliverables/workinggroup.aspx?wg=testingtools
- Delete all the Java code written in the first two steps.
- Use wsimport to generate server side artifacts from the WSDL.
- Fill in the implementation of the different methods in the endpoint implementation class generated in the previous step.
- Use wsimport to generate client side artifacts from the WSDL.
- Implement a client using the artifacts generated in the previous step.
Best wishes!
+Pie Number of slices to send: Send
Thanks Ivan. What do I need to install to get this "wsimport" tool ?
+Pie Number of slices to send: Send
Hi!
Both wsimport and wsgen are part of the standard JDK as per version 1.6, so if you have it installed, then no additional installs are needed.
They are also present in GlassFish, in the bin directory in the installation directory.
Best wishes!
+Pie Number of slices to send: Send
 

ben oliver wrote:new to web service. when developing a web service application, usually how do we come up with a wsdl file ? do we usually first write a java code then convert it to wsdl using tool or what ? does it make sense to create a wsdl first without using any java code ? -- assuming I am using java lang for WS.



It's a big question. Quite often it's referred to as Top Down or Bottom up approach. For example, in WebSphere, please look at sections 17 (JAXB - Top down) and 21 (JAXB - Bottom-up).

You can also Google for something like bottom up wsdl or top down interface.

Regards,
Dan




and POOF! You're gone! But look, this tiny ad is still here:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1824 times.
Similar Threads
jdk 6 new feature
how to convert my legacy code using JAX-RPC to JAX-WS
From where the WSDL come from?
.net and java
Web Services Doubts to Clarify
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:56:14.