jQuery in Action, 3rd edition
The moose likes Web Services and the fly likes WSDL: Schema Duplicate cause dupicate classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL: Schema Duplicate cause dupicate classes" Watch "WSDL: Schema Duplicate cause dupicate classes" New topic

WSDL: Schema Duplicate cause dupicate classes

Deena Jeyachandran

Joined: May 24, 2008
Posts: 18
I am developing WS clients.
The host has given 2 WSDLs. One to Select details of employee. The second WSDL is to create task details for an employee. The target namespace for schema in both WSDLs are different. Employee complex type is represented in the schema in both WSDLs
I used WSDL2Java with XMLBeans to generate Java classes at client side.
Becaue of different target namespaces, I have Employee Class that is present in two different packages.

For eg. Consider the target namespace is "hhtp:/A" for WSDL A and "http:/B" for WSDL B

If I use WSDL A to retrieve the details of an employee, they are stored in A.Employee class object.

But to create a task, I need put the details of Employee in B.Employee class object.

I tried .xsd config in WSDL to generate all the classes for the schema in folder for both WSDLs. instead of generate two packages A & B, there was only one employee class. I was happy, but not for long. The Employee class contains target namespace details for each attribute (like Emp No, Name, etc)
For eg.
private static final javax.xml.namespace.QName ID$0 = new javax.xml.namespace.QName("http://B", "Id");

When I called service in A to get Emp Details,
So the Employee details are not getting set in the Java class because, QName is searching for ID field in namespace B which wont be there in the response from service A.

Please help.


Preparing SCBCD.....
I agree. Here's the link: http://aspose.com/file-tools
subject: WSDL: Schema Duplicate cause dupicate classes
It's not a secret anymore!