views:

503

answers:

5

I haven't had any experience with web service related development. So, any ideas will be greatly appreciated.

Suppose, I have a file listing draft specification of WSDL operations. Following is one example. How would I go about creating the WSDL file. Is notepad sufficient or do I need to have WSDL editor?

getHostSystemInfo

Returns detailed information about host systems specified via given IDs.

  • input HostSystemIdCollection(Collection of Strings)
  • Output HostSystemInfoCollection
    • HostSystemInfo
      • Id: mandatory
      • Properties: Following properties should be provided for host systems
        • HostSystemName
        • HostSystemProperty1
        • HostSystemProperty2
        • HostSystemProperty3 .... ....
A: 

You could use Axis2 to create that for you.

OscarRyz
Honestly, I really don't get why people do like Axis2: the deployment model sucks, the performances suck (http://weblogs.java.net/blog/kohsuke/archive/2007/02/jaxws_ri_21_ben.html). It just sucks!
Pascal Thivent
i remember (3 years ago) it implemented some WS-* specs which others didn't have. this of course could have changed today. on the java side i also preferred JAXWS where possible.
manuel aldana
+1  A: 

If the question is just "how do I create the WSDL" then you could indeed use Notepad and just write it, it's only XML after all. However, writing syntactically correct XML by hand is pretty dull, and error prone. So I would recommend using WSDL aware tooling for example an Eclipse editor

An alternative is to write some Java which expresses the interface, and from it generate the WSDL. There are many ways of doing this, including starting with an EJB and annotating it accordingly. A few googles should help you find what you need.

My experience is that simple POC situations tend to work well starting at the Java. Larger scale projects benfit from considered designs starting at the WSDL.

djna
+1  A: 

If you haven't done any web services before, I would strongly recommend a WSDL Editor. The Netbeans has a plugin that should help.

The other way of doing it, which may be easier is by using the Java annotations defined in JSR 181.

jamie mccrindle
the latest release that contained the SOA functionality was NetBeans IDE 6.5.1 ... :(
wj
+1  A: 

Of course you could use the worst text editor in the world (!) but I'd seriously consider using any decent XML editor or IDE (Eclipse's WSDL support is pretty decent). This will save you a lot of pain and suffer.

Or, if this is an option, you could just annotate a Java class with JAX-WS annotations and have your WSDL dynamically generated from the Java code. Personally, I prefer the WSDL-first approach, the Java-first approach is just a suggestion to get you started.

Pascal Thivent
+1  A: 

coding WSDL by hand is a big pain! i used a XML editor for creation of and then generated the stubs with JAXWS. It is important to understand and differences of the WSDL styles, which is not trivial (have a look at WSDL styles). a good help is to import the WSDL schema to your IDE (eclipse, idea) and then work with autocompletion.

just for interest, why are you using WSDL + SOAP. if you have a choice and you use anyway HTTP, have a look at REST. It can make implementation of web-api a LOT easier, both on server side and for api-clients.

manuel aldana