This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WSDL: Schema Duplicate cause dupicate classes  RSS feed

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Poop goes in a willow feeder. Wipe with this tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!