Problems in processing of xs:any
docampbell Jun 26, 2006 9:42 AMHi guys,
I have an implementation of WS-Reliable Messaging, which uses Axis and WebLogic. I am trying to convert it to be open-source based, using JBoss as the WS container.
To do this, I need to generate code from my WSDL, which I then implement as a web service (using the standard ws-tools that JBoss supplies), which all works fine and dandy.
Problem is, however, that the WS-Reliable Messaging spec likes to include a ws:any in all of its elements to allow for additional XML structures (such as security tokens etc.) to be added as-and-when required.
This leads to web service code that fails to work under JBoss (as far as I can tell, having spent a few weeks looking/delving/trying/proving etc. before posting this).
I get a stack overflow whenever I use a web service that has a ws:any type. I have created a simple WSDL to try test this in isolation, and thought that I had found the answer on a previous forum posting, but to no no avail).
Here is the WSDL snippet that causes a problem:
<xs:complexType name="CreateTestOutputT"> <xs:sequence> <xs:element name="createOutput" type="xs:string"/> <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> <xs:element name="CreateTestOutput" type="tns:CreateTestOutputT"/>
If the element CreateTestOutput is the return from a web service, then the call to it produces a stack overflow similar to this:
at org.jboss.xb.binding.AttributesImpl.<init>(AttributesImpl.java:60) at org.jboss.xb.binding.AttributesImpl.<init>(AttributesImpl.java:42) at org.jboss.xb.binding.Content$StartElement.<init>(Content.java:303) at org.jboss.xb.binding.Content.startElement(Content.java:191) at org.jboss.xb.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:681) at org.jboss.xb.binding.XercesXsMarshaller.marshalElementType(XercesXsMarshaller.java:414) at org.jboss.xb.binding.XercesXsMarshaller.marshalElement(XercesXsMarshaller.java:380) at org.jboss.xb.binding.XercesXsMarshaller.marshalElementOccurence(XercesXsMarshaller.java:886) at org.jboss.xb.binding.XercesXsMarshaller.marshalWildcard(XercesXsMarshaller.java:1018) ... ...
I have set the maxOccurs to 1 in an attempt to stop wildcarding (which I thought was the problem, but it isn't).
I am now completely stuck, as I cannot use the original Axis generated code, so have nowhere else to go ...
Any help/thoughts etc. would be greatly appreciated.
Thanks,
Dominic.