0 Replies Latest reply on Oct 4, 2005 2:05 PM by Duane Homick

    Bean within a Bean in Document/Literal WS Causing Deserializ

    Duane Homick Newbie

      Using JBoss 4.0.2:

      org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.

      wsdl:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <definitions name="OrganizationService"
       targetNamespace="http://webservice.test.jboss.org"
       xmlns:tns="http://webservice.test.jboss.org"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
       <types>
       <xsd:schema targetNamespace="http://webservice.test.jboss.org"
       xmlns:tns="http://webservice.test.jboss.org"
       xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns="http://www.w3.org/2001/XMLSchema"
       elementFormDefault="unqualified"
       attributeFormDefault="unqualified">
      
       <!-- Define general elements -->
       <xsd:element name="Help">
       <xsd:complexType>
       <xsd:sequence>
       <xsd:element name="subscriptionId" type="xsd:string"/>
       <xsd:element name="associateTag" type="xsd:string"/>
       <xsd:element name="validate" type="xsd:string"/>
       <xsd:element name="person" type="tns:Person"/>
       </xsd:sequence>
       </xsd:complexType>
       </xsd:element>
      
       <xsd:complexType name="Person">
       <xsd:sequence>
       <xsd:element name="firstName" type="xsd:string"/>
       <xsd:element name="lastName" type="xsd:string"/>
       </xsd:sequence>
       </xsd:complexType>
      
      
       </xsd:schema>
       </types>
      
       <message name="SimpleRequestMsg">
       <part name="request" element="tns:Help"/>
       </message>
       <message name="SimpleResponseMsg">
       <part name="reply" element="tns:Help"/>
       </message>
      
       <portType name="Organization">
       <operation name="simpleOperation">
       <input message="tns:SimpleRequestMsg"/>
       <output message="tns:SimpleResponseMsg"/>
       </operation>
       </portType>
      
       <binding name="OrganizationBinding" type="tns:Organization">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <operation name="simpleOperation">
       <soap:operation soapAction="http://soap.sandvine.com"/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       </binding>
      
       <service name="OrganizationService">
       <port name="OrganizationPort" binding="tns:OrganizationBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
       </service>
      
      </definitions>
      



      ws4ee-deployment.xml
      <deployment
       xmlns='http://xml.apache.org/axis/wsdd/'
       xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
       xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
       xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
       xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
      
      
       <typeMapping
       qname='ns1:>Help' xmlns:ns1='http://webservice.test.jboss.org'
       type='java:org.jboss.test.webservice.Help'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       <typeDesc>
       <elementDesc fieldName='subscriptionId' xmlName='subscriptionId'/>
       <elementDesc fieldName='associateTag' xmlName='associateTag'/>
       <elementDesc fieldName='validate' xmlName='validate'/>
       <elementDesc fieldName='person' xmlName='person' xmlType="ns1:Person"/>
       <elementOrder>
       <element name='subscriptionId'/>
       <element name='associateTag'/>
       <element name='validate'/>
       <element name='person'/>
       </elementOrder>
       </typeDesc>
       </typeMapping>
      
       <typeMapping
       qname='ns1:Help' xmlns:ns1='http://webservice.test.jboss.org'
       type='java:org.jboss.test.webservice.Help'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       <typeDesc>
       <elementDesc fieldName='subscriptionId' xmlName='subscriptionId'/>
       <elementDesc fieldName='associateTag' xmlName='associateTag'/>
       <elementDesc fieldName='validate' xmlName='validate'/>
       <elementDesc fieldName='person' xmlName='person' xmlType="ns1:Person"/>
       <elementOrder>
       <element name='subscriptionId'/>
       <element name='associateTag'/>
       <element name='validate'/>
       <element name='person'/>
       </elementOrder>
       </typeDesc>
       </typeMapping>
      </deployment>
      



      Any help would be greatly appreciated?

      Also, it seems that there are lots of problems with document/literal WS in the JBossWS forums and elsewhere. Is it safe to use JBossWS document/literal in a production environment?