[ 
http://issues.apache.org/jira/browse/AXIS2-1361?page=comments#action_12442775 ] 
            
Amila Chinthaka Suriarachchi commented on AXIS2-1361:
-----------------------------------------------------

following element causes this bug.

    <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>

the parsing of the simple content is not properly handle by ADB.
 
In the xml, passed to ADBBeanTemplate.xsl,  have 'simple' attribute present in 
both bean element and the property element. Does any one knows what those two 
attributes exactly mean? 

eg. 
<bean name="TypeInformation" originalName="TypeInformation" 
package="com.sosnoski.ws.library.types"
      nsuri="http://ws.sosnoski.com/library/types"; nsprefix="ns1" 
unwrapped="yes" type="yes"
      mapperClass="com.sosnoski.ws.library.wsdl.ExtensionMapper" simple="yes">
    <property name="string" nsuri="http://www.w3.org/2001/XMLSchema"; 
javaname="String" type="java.lang.String"
              shorttypename="string" simple="yes" minOccurs="1"/>
    <property name="count" nsuri="" javaname="Count" type="int" primitive="yes" 
attribute="yes" shorttypename="int"
              simple="yes" minOccurs="1"/>
    <property name="name" nsuri="" javaname="Name" type="java.lang.String" 
attribute="yes" shorttypename="string"
              simple="yes" minOccurs="1"/>
</bean>

> 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: Blocker
>         Attachments: library.zip
>
>
> 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