axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schmitz <christian.schm...@opitz-consulting.de>
Subject client throws SAXExeption while deserializing
Date Mon, 21 Nov 2005 13:00:32 GMT
Hi,

I am using axis 1.3 and this simple test-service crashes at the client side:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Testservice"
                  targetNamespace="http://test.de"
                  xmlns:test="http://test.de"
                  xmlns:testdaten="http://transport.test.de"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:types>
    <xsd:schema targetNamespace="http://transport.test.de">
          <xsd:complexType name="Results">
            <xsd:sequence>
              <xsd:element name="resultLines" nillable="false" 
minOccurs="0" maxOccurs="unbounded" type="testdaten:ResultLine" />
            </xsd:sequence> 
          </xsd:complexType> 
          <xsd:complexType name="ResultLine">
            <xsd:sequence>
              <xsd:element name="hits" nillable="false" minOccurs="0" 
maxOccurs="unbounded" type="testdaten:Hit" />
            </xsd:sequence> 
          </xsd:complexType>    
          <xsd:complexType name="Hit">
            <xsd:sequence>
              <xsd:element name="id" nillable="false" type="xsd:decimal" />
              <xsd:element name="isElem" nillable="false" 
type="xsd:boolean" />
            </xsd:sequence> 
          </xsd:complexType>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="getResultsRequest">
  </wsdl:message>
  <wsdl:message name="getResultsResponse">
    <wsdl:part name="outputArray" type="testdaten:Results"/>
  </wsdl:message>
  <wsdl:portType name="Testservice">
    <wsdl:operation name="getResults">
      <wsdl:input message="test:getResultsRequest"/>
      <wsdl:output message="test:getResultsResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="TestserviceSOAPBinding" type="test:Testservice">
    <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getResults">
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Testservice">
    <wsdl:port binding="test:TestserviceSOAPBinding" name="Testservice">
      <soap:address 
location="http://localhost:8889/ws/services/Testservice"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

At the client side I get a SAXException:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXException: Found character data inside an 
array element while deserializing
 faultActor:
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: 
Found character data inside an array element while deserializing
    at 
org.apache.axis.encoding.ser.ArrayDeserializer.characters(ArrayDeserializer.java:502)
    at 
org.apache.axis.encoding.DeserializationContext.characters(DeserializationContext.java:966)
    at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:177)
    at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
    at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
    at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
    at org.apache.axis.client.Call.invoke(Call.java:2467)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at 
de.test.TestserviceSOAPBindingStub.getResults(TestserviceSOAPBindingStub.java:175)
    at de.test.TestClient.main(TestClient.java:18)

    {http://xml.apache.org/axis/}hostname:LAP52

org.xml.sax.SAXException: Found character data inside an array element 
while deserializing
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.client.Call.invoke(Call.java:2470)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at 
de.test.TestserviceSOAPBindingStub.getResults(TestserviceSOAPBindingStub.java:175)
    at de.test.TestClient.main(TestClient.java:18)
Caused by: org.xml.sax.SAXException: Found character data inside an 
array element while deserializing
    at 
org.apache.axis.encoding.ser.ArrayDeserializer.characters(ArrayDeserializer.java:502)
    at 
org.apache.axis.encoding.DeserializationContext.characters(DeserializationContext.java:966)
    at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:177)
    at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
    at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
    at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
    at org.apache.axis.client.Call.invoke(Call.java:2467)
    ... 4 more
Exception in thread "main"


Here is the genrated SOAP Response:

   <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>
         <getResultsResponse xmlns="">
            <outputArray xsi:type="ns1:Hit" 
xmlns:ns1="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place xsi:nil="true"/>
            </outputArray>
            <outputArray xsi:type="ns2:Hit" 
xmlns:ns2="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place xsi:nil="true"/>
            </outputArray>
            <outputArray xsi:type="ns3:Hit" 
xmlns:ns3="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place xsi:nil="true"/>
            </outputArray>
            <outputArray xsi:type="ns4:Hit" 
xmlns:ns4="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place xsi:nil="true"/>
            </outputArray>
            <outputArray xsi:type="ns5:Hit" 
xmlns:ns5="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place xsi:nil="true"/>
            </outputArray>
            <outputArray xsi:type="ns6:Hit" 
xmlns:ns6="http://transport.test.de">
               <id>1</id>
               <isElem>true</isElem>
               <place>test</place>
            </outputArray>
         </getResultsResponse>
      </soapenv:Body>
   </soapenv:Envelope>

If I redeploy the service to the running server, the SOAP-Message 
doesn't contain the xsi-Types for outputArray and everthing works fine. 
But if I restart the server client crashes again.

This is the SOAP Response after redeployment:

   <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>
         <getResultsResponse xmlns="">
            <outputArray>
               <outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place xsi:nil="true"/>
                  </outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place xsi:nil="true"/>
                  </outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place xsi:nil="true"/>
                  </outputArray>
               </outputArray>
               <outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place xsi:nil="true"/>
                  </outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place xsi:nil="true"/>
                  </outputArray>
                  <outputArray>
                     <id>1</id>
                     <isElem>true</isElem>
                     <place>test</place>
                  </outputArray>
               </outputArray>
            </outputArray>
         </getResultsResponse>
      </soapenv:Body>
   </soapenv:Envelope>

Has anybody an idea what's going wrong?

Regards,
Christian


Mime
View raw message