1 Reply Latest reply on Feb 20, 2008 12:38 PM by Jim Dummy

    @XmlAnyElement and namespace

    Jim Dummy Newbie

      Hello all,

      I have a problem with XmlAnyElement

      @XmlAnyElement(lax = true)


      JBoss remove the namespace from my object while marshalling.

      I just making an echo service with JDK6 client.

      So, client sends:

      <?xml version="1.0" encoding="UTF-8"?>
      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
       <S:Body>
       <ns1:MOBY xmlns:ns1="http://www.biomoby.org/moby">
       <ns1:mobyContent>
       <ns1:mobyData ns1:queryID="sip_1">
       <ns1:Simple ns1:articleName="id">
       <ns1:Object ns1:id="1pio" ns1:namespace="PDB"/>
       </ns1:Simple>
       </ns1:mobyData>
       </ns1:mobyContent>
       </ns1:MOBY>
       </S:Body>
      </S:Envelope>
      


      JBoss serialize it into the object and sends it back

      @WebResult(name="MOBY", targetNamespace="http://www.biomoby.org/moby")
       public MobyMessage runMyService(@WebParam(name="MOBY", targetNamespace="http://www.biomoby.org/moby", mode = WebParam.Mode.IN) MobyMessage msg)
       {
       return msg;
       }
      


      so the marshalled by JBoss message is ALMOST the same

      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Header/>
       <env:Body>
       <ns1:MOBY xmlns:ns1="http://www.biomoby.org/moby">
       <ns1:mobyContent>
       <ns1:mobyData ns1:queryID="sip_1">
       <ns1:Simple ns1:articleName="id">
       <Object ns1:id="1pio" ns1:namespace="PDB" xmlns=""/>
       </ns1:Simple>
       </ns1:mobyData>
       </ns1:mobyContent>
       </ns1:MOBY>
       </env:Body>
      </env:Envelope>
      


      except that where I have
      @XmlAnyElement(lax = true)
      Object getObject()
      


      it puts EMPTY namespace.

      is this a bug? Because SUN JAX-WS implementation marshals it OK.

      Thank You,

      Ratoo