1 Reply Latest reply on Aug 23, 2004 8:32 AM by Alon Agmon

    org.xml.sax.SAXException: SimpleDeserializer encountered a c

    ilays Newbie

      Hello ,
      i deployed a simple bean ws - (using the axis1.2 beta)
      wsdl created using - java2wsdl -

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions targetNamespace="http://ws.test1/ws4ee" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ws.test1/ws4ee" xmlns:intf="http://ws.test1/ws4ee" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <!--WSDL created by Apache Axis version: 1.2beta
      Built on Mar 31, 2004 (12:47:03 EST)-->
       <wsdl:types>
       <schema elementFormDefault="qualified" targetNamespace="http://ws.test1/ws4ee" xmlns="http://www.w3.org/2001/XMLSchema">
       <element name="in0" type="xsd:string"/>
       <element name="getInfoReturn" type="xsd:string"/>
       </schema>
       </wsdl:types>
      
       <wsdl:message name="getInfoResponse">
      
       <wsdl:part element="impl:getInfoReturn" name="getInfoReturn"/>
      
       </wsdl:message>
      
       <wsdl:message name="getInfoRequest">
      
       <wsdl:part element="impl:in0" name="in0"/>
      
       </wsdl:message>
      
       <wsdl:portType name="HelloEndpoint">
      
       <wsdl:operation name="getInfo" parameterOrder="in0">
      
       <wsdl:input message="impl:getInfoRequest" name="getInfoRequest"/>
      
       <wsdl:output message="impl:getInfoResponse" name="getInfoResponse"/>
      
       </wsdl:operation>
      
       </wsdl:portType>
      
       <wsdl:binding name="HelloPortSoapBinding" type="impl:HelloEndpoint">
      
       <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      
       <wsdl:operation name="getInfo">
      
       <wsdlsoap:operation soapAction=""/>
      
       <wsdl:input name="getInfoRequest">
      
       <wsdlsoap:body namespace="http://ws.test1/ws4ee" use="literal"/>
      
       </wsdl:input>
      
       <wsdl:output name="getInfoResponse">
      
       <wsdlsoap:body namespace="http://ws.test1/ws4ee" use="literal"/>
      
       </wsdl:output>
      
       </wsdl:operation>
      
       </wsdl:binding>
      
       <wsdl:service name="HelloServiceJSE">
      
       <wsdl:port binding="impl:HelloPortSoapBinding" name="HelloPort">
      
       <wsdlsoap:address location="http://localhost:8080/hello/exactpath"/>
      
       </wsdl:port>
      
       </wsdl:service>
      
      </wsdl:definitions>


      mapping.xml :
      ....
      <package-mapping>
       <package-type>ws.test1</package-type>
       <namespaceURI>http://ws.test1/ws4ee</namespaceURI>
       </package-mapping>
      
       <java-xml-type-mapping>
       <java-type>java.lang.String</java-type>
       <root-type-qname>impl:in0</root-type-qname>
       <qname-scope>element</qname-scope>
       </java-xml-type-mapping>
       <java-xml-type-mapping>
       <java-type>java.lang.String</java-type>
       <root-type-qname>impl:getInfoReturn</root-type-qname>
       <qname-scope>element</qname-scope>
       </java-xml-type-mapping>
      ......


      service was deployed ,wsdl was published !!
      i used wsdl2java to create these classes for a standalone client :

      HelloEndpoint.class
      HelloPortSoapBindingStub.clas
      HelloServiceJSE.class
      HelloServiceJSELocator.class

      and the client:
      wsClient1.class

      clients code:

      HelloServiceJSE service = new HelloServiceJSELocator();
      
       System.out.println("service locator ---");
      
       HelloEndpoint port = service.getHelloPort();
      
       System.out.println("got port ---");
      
       System.out.println(port.getInfo("test"));



      ok.. every thing look good now ,
      when i run the test:

       [java] service locator ---
       [java] got port ---
       [java] ; nested exception is:
       [java] org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying
      deserialize.


      well ... im kinda lost
      i think something is wrong here - because i used both
      java2wsdl and wsdl2java on the same classes and SEI
      so how can it encounter a child element, which is NOT expected,
      the problem also exist in axis 1.1