I have generated a client using Axis2 framework with XMLBeans as the data binding method.
The XSD schema is the following:
<xsd:schema>
<xsd:element name="profile" type="anyType"/>
</xsd:schema>
The java object generated which takes part of the SOAP request contains getter and setter methods that allow to get and set the profile. Here is the method signature:
requestDocument.setProfile(XmlObject profile);
The problem is that even if that I have to pass several nodes as the profile and not a valid XML document, but XMLObject expects a XML document with a root node.
I need to pass:
<accounts></accounts>
<payees></payees>
Actually, the service I use expects those nodes but did not constrains them in the schema. Thus, I can't add another root node because even if the service won't throw any exceptions, the profile won't be usable.
XMLBeans already adds the underlying XML tree, I mean the profile node in the request document. Thus, I can't use it as a root node. if I add a root node, the following XML will be created
<profile>
<profile></profile>
</profile>
And I want the document be formatted as follow:
<profile>
<accounts></accounts>
<payees></payees>
</profile>
I prefer not modifying the schema of the service. I would want to know if there is a way with Axis2/XMLBeans to tackle this issue.