This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Java2WSDL & WSDL2Java tools ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java2WSDL & WSDL2Java tools ?" Watch "Java2WSDL & WSDL2Java tools ?" New topic
Author

Java2WSDL & WSDL2Java tools ?

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Hi all,

I am trying some webv services examples in Axis 1.4 with Tomcat 4.1.29.
What the Java2WSDL & WSDL2Java tools will do? Whether we have to write WSDL files manually? For writing the WSDL files(XML file?), whether we need to know SOAP? and any other thing we need to know for writing WSDL files?
Rupa Singh
Greenhorn

Joined: Oct 29, 2006
Posts: 4
Java2WSDL tool will convert a Java class into a WSDL file. And WSDL2Java will do the reverse.

WSDL files are usually tedious to write and I do not think you need to write them manually. You can use tools like Java2WSDL.
Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Thanks for your reply.
So we can get the WSDL xml file from java class. java class means any java class or the java class to follow certain rules for getting WSDL. Simply, for any java files, we can get the WSDL from Java2WSDL tool?
Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Thanks for your reply.
So we can get the WSDL xml file from java class. java class means any java class or the java class to follow certain rules for getting WSDL. Simply, for any java files, we can get the WSDL from Java2WSDL tool?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41178
    
  45
I think any public method will be exposed as a WS operation. This article talks a bit about the wsdl2java and java2wsdl tools.


Ping & DNS - my free Android networking tools app
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Rupa Singh:
WSDL files are usually tedious to write and I do not think you need to write them manually.


Which is why you should be using an XML tool that "understands" WSDL to help you write them. Writing Web Services WSDL first is simply part of a sound "Interface First" design approach.

3.4.1 Designing the Interface.

Also Web Services don't simply let you "beam" arbitrary Java objects over to the client because:
  • XML is hierarchical in nature - not object oriented
  • The client may not even be Java based

  • So when you design a Web service you need to focus on the information (and its structure) that is exchanged - forget about objects.
    Peer Reynders
    Bartender

    Joined: Aug 19, 2005
    Posts: 2922
        
        5
    Originally posted by Mark Henryson:
    For writing the WSDL files(XML file?), whether we need to know SOAP? and any other thing we need to know for writing WSDL files?


    Primarily you should have a solid understanding of XML and XML Schema. You should also understand the aspects of WSDL as they are permitted under the Basic Profile - mainly so you can recognize a WSDL that may cause some trouble, and so you have an idea of what you can do about it.
    Knowledge of SOAP will come in handy when you need to debug the SOAP messages that are being sent/received.
    [ November 01, 2006: Message edited by: Peer Reynders ]
    Peer Reynders
    Bartender

    Joined: Aug 19, 2005
    Posts: 2922
        
        5
    Originally posted by Mark Henryson:
    Simply, for any java files, we can get the WSDL from Java2WSDL tool?

    The realistic answer is no. The Java2WSDL will always try to generate a WSDL and in most cases it will. However there is no guarantee that it will be a "good/useful" WSDL. If both server and client are Java-based you could use the infamous SOAP1.1: 5. SOAP Encoding, but even there you will have to create your own custom serializer and deserializer classes for any of your own "more complicated" classes - even for some of the classes in the Java Standard Library. Any Java clients that don't have your custom serializer and deserializer classes couldn't work even if they had access to the WSDL. And non-Java clients would most likely not work.
    In the "literal" mode you will often have clients (working from the WSDL) reconstituting the information in their own generated classes and objects - no the ones that were used with the Java2WSDL tool - even if the classes used were standard Java classes (e.g. HashMap).
    [ November 01, 2006: Message edited by: Peer Reynders ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Java2WSDL & WSDL2Java tools ?
     
    Similar Threads
    Web-app to web-service (Axis)
    Axis 1.3 - WSDL2JAVA issue
    what is more right java2wsdl or wsdl2java
    Web Services Doubts to Clarify
    java2WSDL and WDL2java