Errors parsing response document with ADB databinding and simpleContent
-----------------------------------------------------------------------

                 Key: AXIS2-1361
                 URL: http://issues.apache.org/jira/browse/AXIS2-1361
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: nightly
         Environment: Linux, JDK 1.5.0_07
            Reporter: Dennis Sosnoski
            Priority: Critical


Testing the latest SVN code, and using this WSDL (relevant portions only):

<wsdl:definitions targetNamespace="http://ws.sosnoski.com/library/wsdl";
    xmlns:wns="http://ws.sosnoski.com/library/wsdl";
    xmlns:tns="http://ws.sosnoski.com/library/types";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:types>
  
    <schema elementFormDefault="qualified"
        targetNamespace="http://ws.sosnoski.com/library/wsdl";
        xmlns="http://www.w3.org/2001/XMLSchema";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
      <import namespace="http://ws.sosnoski.com/library/types"/>
      ...
      <element name="getTypes">
        <complexType>
          <sequence/>
        </complexType>
      </element>
      
      <element name="getTypesResponse">
        <complexType>
          <sequence>
            <element maxOccurs="unbounded" name="getTypesReturn" 
type="tns:TypeInformation"/>
          </sequence>
        </complexType>
      </element>
      
      ...
    </schema>
  
    <schema elementFormDefault="qualified"
        targetNamespace="http://ws.sosnoski.com/library/types";
        xmlns="http://www.w3.org/2001/XMLSchema";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
        ...
      
      <complexType name="TypeInformation">
        <simpleContent>
          <extension base="xsd:string">
            <attribute name="count" use="required" type="int"/>
            <attribute name="name" use="required" type="string"/>
          </extension>
        </simpleContent>
      </complexType>
      
    </schema>
  </wsdl:types>
  ...
  <wsdl:message name="getTypesRequest">
    <wsdl:part element="wns:getTypes" name="parameters"/>
  </wsdl:message>
  <wsdl:message name="getTypesResponse">
    <wsdl:part element="wns:getTypesResponse" name="parameters"/>
  </wsdl:message>
  ...
  <wsdl:portType name="Library">
    ...
    <wsdl:operation name="getTypes">
      <wsdl:input message="wns:getTypesRequest" name="getTypesRequest"/>
      <wsdl:output message="wns:getTypesResponse" name="getTypesResponse"/>
    </wsdl:operation>
    ...
  </wsdl:portType>

The server responds to the getTypes operation with the following XML:

<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Header />
      <soapenv:Body>
         <ns2:getTypesResponse xmlns:ns2="http://ws.sosnoski.com/library/wsdl";>
            <ns2:getTypesReturn count="3" name="java">About 
Java</ns2:getTypesReturn>
            <ns2:getTypesReturn count="3" name="scifi">Science 
fiction</ns2:getTypesReturn>
            <ns2:getTypesReturn count="2" name="xml">About 
XML</ns2:getTypesReturn>
         </ns2:getTypesResponse>
      </soapenv:Body>
   </soapenv:Envelope>

This looks valid, but the client throws an exception:

     [java] Retrieved 'Infinity Beach'
     [java] Exception in thread "main" java.lang.RuntimeException: 
org.apache.axiom.om.impl.exception.OMStreamingException: 
com.ctc.wstx.exc.WstxParsingException: Current state not START_ELEMENT
     [java]  at [row,col {unknown-source}]: [1,268]
     [java]     at 
com.sosnoski.ws.library.adb.LibraryAdbStub.fromOM(LibraryAdbStub.java:1039)
     [java]     at 
com.sosnoski.ws.library.adb.LibraryAdbStub.getTypes(LibraryAdbStub.java:701)
     [java]     at 
com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:54)
     [java] Caused by: org.apache.axiom.om.impl.exception.OMStreamingException: 
com.ctc.wstx.exc.WstxParsingException: Current state not START_ELEMENT
     [java]  at [row,col {unknown-source}]: [1,268]
     [java]     at 
org.apache.axiom.om.impl.llom.OMStAXWrapper.getElementText(OMStAXWrapper.java:838)
     ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to