Categories
Java Web Development

Axis nsmap.properties

Trying to generate classes from a SOAP WSDL is pretty easy, especially if you are using Ant. You simply run the axis-wsdl2java task and you get the stub classes. The problem is that if your WSDL file looks like this:


<wsdl :definitions
targetNamespace="http://localhost/axis/services/MyService">
</wsdl>
<schema targetNamespace="http://myservice.yzukerman.cscie162.harvard">

The classes will be generated into two directories:

  • The Axis infrastructure classes will be generated into:

    localhost/axis/services/MyService

    Which corresponds to the WSDL URL

  • The service stubs will be generated into:
    harvard/cscie162/yzukerman/myservice

    which is in the reverse order of the namespace URL

To overcome that, Axis can use a namespace mapping file, nsmap.properties which maps the namespace names into the package names you want each of the remote namespaces (Axis classes, stub classes) to be generated into. So, for the above files to both be mapped under a package called com.enavigo.myservice, the nsmap will look like this:

http\://myservice.yzukerman.cscie162.harvard=
com.enavigo.myservice

http\://localhost/axis/services/MyService=com.enavigo.myservice

My co-worker Nate Pickett helped me with this ‘discovery’.

Look at this JavaWorld article to more.

Share
Categories
Java Web Development

Axis and Java 1.5 Problem

If you use Java 1.5 and try to use Axis 1.1’s WSDL2Java utility to read a WSDL file and generate Java stubs, you will notice that when the utility generates Enumeration objects which it names enum. Enum is a keyword in Java 1.5 (whoopie!) – so your code will not compile. This sucks.

Update: April 19, 2005
To make the compilation work, use the -source 1.4 switch. In the Ant javac task, add the source attribute and set it to 1.4.

Share
Categories
Web Development

New (to me) embedded web content editor from Mozilla

While browsing through the Firefox extension site I noticed cuneAform – which appears to be a browser-based editor that is embeddable in a web page. These are JavaScript components that you can add to a web page and that give users a word processor-like experience with a toolbar offering text manipulation functions (bold, italic, etc.) and more HTML-specific functions (styles, tables, image upload).

In the past, these editors sorta sucked because they were browser specific (I used soEditor which is IE specific and checked out BitFlux which was pretty hostile and did not work with IE). The best such editor I actually used is the Hardcore Internet editor which works really well and the company that produces it offers spectacular support for it. [Spectacular = bug resolution in less than 12 hours]

cuneAform is interesting in that it is both free and that it works with both browsers and is free. I did not check it with Safari or with Opera as this functionality normally is used in a client’s back end of a CMS application and hence the client can enforce the browser that is in use. In the past, that was an excuse to require IE to be used but allowing Firefox is just so better.

Share
Share