WSDLs, oh my! (part 2)


Drat and bugger.

WSDL 1.1 will not handle restful URLs. WSDL 2.0 will, but I can’t find a free editor for it (I approve of “free” as in “beer”).

Apache AXIS claims to support WSDL 2.0. this document at ibm.com seems to be a bit of a wsdl2 tutorial.

So: I shall create a small WSDL, starting with a skeletona nd ask AXIS to convert it into a set of java classes over and over and over again as I edit it by hand using an xml editor.

Here is tmp.wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl">
  <wsdl:types/>
  <wsdl:interface/>
  <wsdl:binding/>
  <wsdl:service/>
</wsdl:description>

Hmm, AXIS has an ant task – I wonder how easy it would be …

WSDLException (at /wsdl:description): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.

Sigh. Schema xmlsoap is the 1.1 WSDL schema. Ok – let’s check the docs for the WSDL2Java command-line tool … nope. No mention whatever of WSDL 2.0. So where is this magical WSDL 2.0 support? I’ll need to go back and find the place where I saw it mentioned

… riiight. I need Axis 2.

Ah ha! Success, of a sort:

[codegen] Woden [Warning],0:0,Description-1001,The targetNamespace 'null' is not dereferencable.
BUILD FAILED/Users/ibis/tmp/WSDL2/build.xml:23: org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL	at 
Caused by: java.lang.NullPointerException

This is actually good. This is the kind of things I would expect if the generator doesn’t handle an empty, skeleton WSDL.

So, lets add some simple operations. Back to the IBM tutorial …

OK! Created the IBM tutorial perfectly OK! This generates client-side stub files … and a test case! So .. eclipse project, set source directories to generated source, add axis2 libraries, add JUnit libraries, and the test case runs. I mean – it fails, but it does run.

Have to dash, but tomorrow I shall attempt to describe (one of the) the services at BOA with WSDL 2.0, and use the generated java to fetch the RDF for Dodonaea cuneata via a java method call. Wouldn’t it be totally brill if AXIS2 returns it not as a string, but as a org.w3c.Document ?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: