• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

WSDL: Schema Duplicate cause dupicate classes

Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

What does a metric clock look like? I bet it is nothing like this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic