1 2 Previous Next 16 Replies Latest reply on May 5, 2006 11:29 PM by Anil Saldanha Go to original post
      • 15. Re: Handling of xml wildcards
        Anil Saldanha Master

        Alexey, I would like to get your opinion on a wsrp usecase that Julien sought my help on.

        The xsd type is defined as follows:

         <complexType name="Extension">
         <sequence>
         <any namespace="##other"/>
         </sequence>
         </complexType>
        


        And the SOAP Message looks thus:
        <?xml version="1.0" encoding="UTF-8"?>
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <soapenv:Body>
         <urn:getMarkup xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
         <urn:registrationContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
         <urn:portletContext>
         <urn:portletHandle>samples.CachedCounterPortlet</urn:portletHandle>
         </urn:portletContext>
         <urn:namespacePrefix>T400580891145574387623</urn:namespacePrefix>
         <urn:extensions>
         <urn1:DummyMain xmlns:urn1="urn:dummy:wsrp:ext:v1:types">
         <urn1:dummysmall>text</urn1:dummysmall>
         </urn1:DummyMain>
         </urn:extensions>
         </urn:runtimeContext>
         <urn:userContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
         <urn:markupParams>
         ......
         </urn:markupParams>
         </urn:getMarkup>
         </soapenv:Body>
        </soapenv:Envelope>
        


        The error thrown on the server side is:
        Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Requested element {urn:
        dummy:wsrp:ext:v1:types}DummyMain is not allowed in this position in the sequence.
         at org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1.startElem
        ent(SequenceBinding.java:315)
         at org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding$Cursor.st
        artElement(ModelGroupBinding.java:151)
         at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startE
        lement(SundayContentHandler.java:189)
         at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHan
        dler.startElement(SaxJBossXBParser.java:299)
        


        The question I have is:
        - should the unmarshalling layer ignore the extensions? The schema file for the xml block pinned in the extensions element is not available to the XB layer during unmarshalling.

        You can see this in action in the Branch _4_0 testsuite with:
        ant -Dtest=org.jboss.test.wsrp.MarkupTestCase one-test


        • 16. Re: Handling of xml wildcards
          Anil Saldanha Master

           

          <complexType name="Extension">
           <sequence>
           <any namespace="##other" processContents="lax" />
           </sequence>
           </complexType>


          That was the issue. Thanks to Jason for pointing it out.

          1 2 Previous Next