Hi, 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.