Epitaph
Epitaph

Reputation: 3148

How to create WSDL file given SOAP WSDL operations

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.

Upvotes: 5

Views: 16172

Answers (5)

manuel aldana
manuel aldana

Reputation: 16458

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.

Upvotes: 4

Pascal Thivent
Pascal Thivent

Reputation: 570545

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.

Upvotes: 1

Jamie McCrindle
Jamie McCrindle

Reputation: 9214

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.

Upvotes: 1

djna
djna

Reputation: 55937

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.

Upvotes: 5

OscarRyz
OscarRyz

Reputation: 199304

You could use Axis2 to create that for you.

Upvotes: 0

Related Questions