1 Reply Latest reply on Dec 20, 2004 8:41 AM by thomas.diesler

    Serializing Beans xsd:anyType ws4ee and apache axis

    chrb

      Hi,

      i'm developing a document/literal webservice for communication between java and c#. After a lot of testing, I found out, that the packages of apache axis and jboss-ws differs in serializing type-information for xsd:anyType. Do you have any Ideas for solving this Problem?

      Thanks a lot,
      Christian

      the java-class looks like this:
      // ------------ Parameter.java ------------------

      [...]
      public class Parameter implements java.io.Serializable {
       private java.lang.String name;
       private java.lang.Object parameterValue;
      
       public Parameter() {
       }
      
       public java.lang.String getName() {
       return name;
       }
      
       public void setName(java.lang.String name) {
       this.name = name;
       }
      
       public java.lang.Object getParameterValue() {
       return parameterValue;
       }
      
       public void setParameterValue(java.lang.Object parameterValue) {
       this.parameterValue = parameterValue;
       }
      }
      


      the description of this ComplexType in my wsdl:
      [...]
      <complexType name="Parameter">
       <sequence>
       <element name="name" nillable="true" type="xsd:string"/>
       <element name="parameterValue" nillable="true" type="xsd:anyType"/>
       </sequence>
      </complexType>
      [...]
      


      My JUnit-Tests (which includes the original apache axis) all work fine; the type-information is given within the xml sent to the server.
      Correct serialized XML (by apache axis)
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <paramList xmlns="http://my.package.org">
       <parameter xmlns="">
       <name>parameterName1</name>
       <parameterValue xsi:type="xsd:string">StringParameterValue1</parameterValue>
       </parameter>
       <parameter xmlns="">
       <name>parameterName2</name>
       <parameterValue xsi:type="xsd:string">StringParameterValue2</parameterValue>
       </parameter>
       </paramList>
       </soapenv:Body>
      </soapenv:Envelope>
      


      After changing the libs from apache-axis to jboss-ws i got this wrong xml (without type-information for my xsd:anyType):
      Incorrect serialized (by jboss-ws)
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <ns1:paramList xmlns:ns1="http://my.package.org">
       <parameter>
       <name>parameterName1</name> <parameterValue>StringParameterValue1</parameterValue>
       </parameter>
       <parameter>
       <name>parameterName2</name>
      <parameterValue>StringParameterValue2</parameterValue> </parameter>
       </ns1:paramList>
       </soapenv:Body>
      </soapenv:Envelope>
      


        • 1. Re: Serializing Beans xsd:anyType ws4ee and apache axis
          thomas.diesler

          The mapping for xsd:anyType is left undefined by the JAXRPC specification. xsd:anyType is useful if you truely have to exchange untyped (random) XML documents.

          We added a mapping for xsd:anyType to oeg.w3c.dom.Element in the upcomming jboss-4.0.1 which you can checkout from CVS.

          cvs co -r Branch_4_0 jboss-4.0
          cd jboss-4.0
          build/build.sh