Forums Register Login
Java class to WSDL

I want to map a java class to wsdl.
The problem is my java class use java.util.Map as function arguments.
I am wondering how to map/bind this java class to wsdl.

Here is the code:


Can anyone tell me how to map the following java class to wsdl (in Eclispe)?

When executing bottom-up mapping in Eclipse, I got the following error:

....does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.

Any suggestion is highly appreciated.

Hi sam,

Try to convert it with Apache Axis2 tools. Using these tools you can convert WSDL to java and java to WSDL.
It is generally a good idea not to use Java collection types, such as Map, List, Set etc, as parameter or return types of methods that are exposed as web service operations.
While it may be possible to make it work with some web service stack(s), there is a significant risk of lock-in.
Best wishes!
Thank you very much for the suggestion.

How about using the following class, and convert it to wsdl?

In Eclipse, it generated the following wsdl using bottom-up approach (java2wsdl):

Is generated wsdl looks correct?

Thank you for your time.

You are aware that you are using a web service stack that was built five years ago?
Unless there is a very good reason for using this particular web service stack, I strongly suggest using something more recent.
A lot has happened in that time, for instance the WS-I Basic Profile and JAX-WS.
Best wishes!
Hi, thank you very much for your comment on my wsdl.

Do you know how to configure WSDL generator in Eclipse so that it generates more recent version of WSDL file?

From the About Eclipse page, it shows

Eclipse Java EE IDE for Web Developers.

Version: Helios Service Release 2
Build id: 20110218-0911

When I looked the generated wsdl file which was generated from Netbeans 7.0, it looks like as follow:

Is the version of WSDL generated by Netbeans 7.0 correct?

In Eclipse, if you look in the Preferences, there is a section named Web Services.
Under that section there are subsections for CXF 2.x Preferences, JBossWS Preferences.
These two allow you to use at least Apache CXF and JBoss WS (these options may require installation of plugins).
It is very easy to write an Ant-file that, given annotated Java classes, generate a WSDL file and use this in Eclipse.
As you may suspect, the web service tooling in Eclipse is not as good as that in NetBeans.
Best wishes!

This thread has been viewed 2622 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 25, 2018 00:49:23.