11 Replies Latest reply on Jul 7, 2006 4:59 AM by Thomas Diesler

    Problems in processing of xs:any

    Dominic Campbell Newbie

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

        • 1. Re: Problems in processing of xs:any
          Dominic Campbell Newbie

          Forgot to mention that I am using JBoss 4.0.4-GA

          • 2. Re: Problems in processing of xs:any
            Heiko Braun Master

            We had seen this problem before (JBWS-934) and it was supposed to be fixed. I will reopen that JIRA issue. In the meantime you could proceed with commenting the wildcard declarations.

            • 3. Re: Problems in processing of xs:any
              Heiko Braun Master

              BTW, if you consider using the jboss dev environment for your project, please contact me directly.

              • 4. Re: Problems in processing of xs:any
                Dominic Campbell Newbie

                Heiko,

                Thanks for the response.

                Commenting out the wildcarding is considerably more complex than it would appear, as the WSDLs that I use are all imported and are WS-* standards based, so I cannot change them!

                I have just mailed you directly.

                Thanks,

                Dominic.

                • 6. Re: Problems in processing of xs:any
                  Dominic Campbell Newbie

                  That's one of the things that I looked at and thought that it had been fixed, so I spent quite a while checking it out. As far as I can tell, the JBoss code that I have does check for null, but this still seems to fail, whether I have a null or not.

                  • 7. Re: Problems in processing of xs:any
                    Heiko Braun Master

                    I wasn't able to recreate that error you are describing. Could you post the WSDL for that's causing this error and a full stacktrace that actually shows the stack overflow?

                    • 8. Re: Problems in processing of xs:any
                      Dominic Campbell Newbie

                      Here's the WSDL (note that I have created this for testing, so it is simple, but a representation of the type of WS-* imports that are used). I will post the stack trace as a separat reply...

                      <?xml version="1.0" encoding="UTF-8"?>
                      
                      <wsdl:definitions
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      xmlns:tns="http://itag.wswg.testing.test"
                      targetNamespace="http://itag.wswg.testing.test"
                      name="TestingServiceWSDL">
                      
                      <wsdl:types>
                       <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://itag.wswg.testing.test" xmlns="http://itag.wswg.testing.test" elementFormDefault="qualified">
                       <xs:complexType name="CreateTestInputT">
                       <xs:sequence>
                       <xs:element name="createInput" type="xs:string"/>
                       <xs:element name="createInputx" type="xs:string"/>
                       </xs:sequence>
                       </xs:complexType>
                       <xs:element name="CreateTestInput" type="tns:CreateTestInputT"/>
                       <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"/>
                       <xs:complexType name="TerminateTestInputT">
                       <xs:sequence>
                       <xs:element name="terminateInput" type="xs:string"/>
                       </xs:sequence>
                       </xs:complexType>
                       <xs:element name="TerminateTestInput" type="tns:TerminateTestInputT"/>
                       <xs:complexType name="TerminateTestOutputT">
                       <xs:sequence>
                       <xs:element name="terminateOutput" type="xs:string"/>
                       </xs:sequence>
                       </xs:complexType>
                       <xs:element name="TerminateTestOutput" type="tns:TerminateTestOutputT"/>
                       <xs:complexType name="SomeHeaderValueT">
                       <xs:sequence>
                       <xs:element name="someHeaderValue" type="xs:string"/>
                       </xs:sequence>
                       </xs:complexType>
                       <xs:element name="SomeHeaderValue" type="tns:SomeHeaderValueT"/>
                       </xs:schema>
                      </wsdl:types>
                      
                      
                      <wsdl:message name="CreateTest">
                       <wsdl:part name="createTest" element="tns:CreateTestInput"/>
                      </wsdl:message>
                      <wsdl:message name="CreateTestResponse">
                       <wsdl:part name="createTestResponse" element="tns:CreateTestOutput"/>
                      </wsdl:message>
                      <wsdl:message name="TerminateTest">
                       <wsdl:part name="terminateTest" element="tns:TerminateTestInput"/>
                      </wsdl:message>
                      <wsdl:message name="TerminateTestResponse"/>
                      <wsdl:message name="SomeHeader">
                       <wsdl:part name="someHeader" element="tns:SomeHeaderValue" />
                      </wsdl:message>
                      
                       <wsdl:portType name="TestingServicePort">
                       <wsdl:operation name="CreateTest">
                       <wsdl:input message="tns:CreateTest"/>
                       <wsdl:output message="tns:CreateTestResponse"/>
                       </wsdl:operation>
                       <wsdl:operation name="TerminateTest">
                       <wsdl:input message="tns:TerminateTest"/>
                       <wsdl:output message="tns:TerminateTestResponse"/>
                       </wsdl:operation>
                      </wsdl:portType>
                      
                      <wsdl:binding name="TestingServiceSoap" type="tns:TestingServicePort">
                       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
                       <wsdl:operation name="CreateTest">
                       <soap:operation soapAction="http://itag.wswg.testing.test/CreateTest"/>
                       <wsdl:input>
                       <soap:header message="tns:SomeHeader" part="someHeader" use="literal"/>
                       <soap:body use="literal"/>
                       </wsdl:input>
                       <wsdl:output>
                       <soap:body use="literal"/>
                       </wsdl:output>
                       </wsdl:operation>
                       <wsdl:operation name="TerminateTest">
                       <soap:operation soapAction="http://itag.wswg.testing.test/TerminateTest"/>
                       <wsdl:input>
                       <soap:body use="literal"/>
                       </wsdl:input>
                       <wsdl:output>
                       <soap:body use="literal"/>
                       </wsdl:output>
                       </wsdl:operation>
                      </wsdl:binding>
                      
                      <wsdl:service name="TestingServiceService">
                       <wsdl:port name="TestingServicePort" binding="tns:TestingServiceSoap">
                       <soap:address location="http://localhost:8080/rm/itag/wswg/tesing/test/services/TestingService"/>
                       </wsdl:port>
                      </wsdl:service>
                      
                      </wsdl:definitions>
                      


                      • 9. Re: Problems in processing of xs:any
                        Dominic Campbell Newbie

                        This is the SOAP that goes in to the request...

                        <?xml version="1.0" encoding="UTF-8"?>
                        <soap:Envelope xmlns:mrns0="http://itag.wswg.testing.test" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                         <soap:Header>
                         <mrns0:SomeHeaderValue>
                         <mrns0:someHeaderValue>A header</mrns0:someHeaderValue>
                         </mrns0:SomeHeaderValue>
                         </soap:Header>
                         <soap:Body>
                         <mrns0:CreateTestInput>
                         <mrns0:createInput>Input One</mrns0:createInput>
                         <mrns0:createInputx>Input Two</mrns0:createInputx>
                         </mrns0:CreateTestInput>
                         </soap:Body>
                        </soap:Envelope>
                        


                        • 10. Re: Problems in processing of xs:any
                          Dominic Campbell Newbie

                          Here's the stack trace (I have cut out a HUGE repeating section for clarity)

                          2006-06-29 10:28:46,939 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TestingService].[TestingService]] Servlet.service() for servlet TestingService threw exception
                          java.lang.StackOverflowError
                           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.marshalSimpleType(XercesXsMarshaller.java:478)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalElementType(XercesXsMarshaller.java:405)
                           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.marshalParticle(XercesXsMarshaller.java:823)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroupSequence(XercesXsMarshaller.java:1102)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroup(XercesXsMarshaller.java:1057)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:729)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:685)
                           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)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalWildcardOccurence(XercesXsMarshaller.java:912)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:789)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroupSequence(XercesXsMarshaller.java:1102)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroup(XercesXsMarshaller.java:1057)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:729)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:685)
                           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)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalWildcardOccurence(XercesXsMarshaller.java:912)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:789)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroupSequence(XercesXsMarshaller.java:1102)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalModelGroup(XercesXsMarshaller.java:1057)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:729)
                          
                           ... same 10 lines (from :685 -> :729 repeated 100 times ...
                          
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:685)
                           at org.jboss.xb.binding.XercesXsMarshaller.marshalElementType(XercesXsMarshaller.java:414)
                          2006-06-29 10:28:47,129 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id T6Y4Qjv5qLiKFpq6uzvmbw**
                          2006-06-29 10:28:47,159 DEBUG [org.jboss.web.tomcat.tc5.session.ClusteredSession] processSessionRepl(): session is dirty. Will increment version from: 0 and replicate.
                          



                          • 11. Re: Problems in processing of xs:any
                            Thomas Diesler Master

                            Hi Domenic,

                            I am reaching out to you to get a better understanding of your WS-RM effort and the possible integration points with JBossWS. Currently we are busy with JAXWS and EE5 certification of our WS stack. Once this is done (probably end of Q3/2006) we are going to look into WS-RM possibly leveraging existing code/experience. If you like we could meet on skype and discuss possible cooperation options WRT WS-RM.

                            Cheers