axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Armbrust (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-2021) String Array Regression causes SAXException: Found character data ...
Date Mon, 06 Jun 2005 14:26:48 GMT
    [ http://issues.apache.org/jira/browse/AXIS-2021?page=comments#action_12312751 ] 

Dan Armbrust commented on AXIS-2021:
------------------------------------

I just tested with yesterdays daily build (6/5/05)  and I am happy to report that there is
progress.  It no longer breaks on simple string returns.  However, now I am seeing it break
when the client code tries to submit a String[] of parameters.


When I call my method "lookupConceptCodesByProperty" - with one item in the "properties" parameter
- the following request is submitted:

<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>
    <lookupConceptCodesByProperty xmlns="urn://hl7.org/CTSVAPI">
      <codeSystem_id>2.16.840.1.113883.5.4</codeSystem_id>
      <matchText />
      <matchAlgorithm_code>StartsWithIgnoreCase</matchAlgorithm_code>
      <language_code>en</language_code>
      <activeConceptsOnly>true</activeConceptsOnly>
      <properties xmlns:ns1="urn://hl7.org/CTSVAPI" xsi:type="ns1:ArrayOf_xsd_string">textualPresentation</properties>
      <mimeTypes xsi:nil="true" />
      <timeout>0</timeout>
      <sizeLimit>10</sizeLimit>
    </lookupConceptCodesByProperty>
  </soapenv:Body>
</soapenv:Envelope>


And here is the response from the server:

<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>
    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: Found character data inside an array element
while deserializing</faultstring>
      <detail>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">mir04</ns1:hostname>
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>


If I change my parameters, such that I don't submit any "properties" items, then the request
looks like this:

<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>
    <lookupConceptCodesByProperty xmlns="urn://hl7.org/CTSVAPI">
      <codeSystem_id>2.16.840.1.113883.5.4</codeSystem_id>
      <matchText />
      <matchAlgorithm_code>StartsWithIgnoreCase</matchAlgorithm_code>
      <language_code>en</language_code>
      <activeConceptsOnly>true</activeConceptsOnly>
      <properties xsi:nil="true" />
      <mimeTypes xsi:nil="true" />
      <timeout>0</timeout>
      <sizeLimit>10</sizeLimit>
    </lookupConceptCodesByProperty>
  </soapenv:Body>
</soapenv:Envelope>

And it works correctly.

So the bug seems to be fixed, as far as the server returning correctly encoded arrays, and
the client parses them correctly.  But something remains broken with the client submitting
arrays of parameters to the server.


Here are snippits of the WSDL generated with this build:

 <element name="lookupConceptCodesByProperty">
    <complexType>
     <sequence>
      <element name="codeSystem_id" type="xsd:string"/>
      <element name="matchText" type="xsd:string"/>
      <element name="matchAlgorithm_code" type="xsd:string"/>
      <element name="language_code" type="xsd:string"/>
      <element name="activeConceptsOnly" type="xsd:boolean"/>
      <element maxOccurs="unbounded" name="properties" type="xsd:string"/>
      <element maxOccurs="unbounded" name="mimeTypes" type="xsd:string"/>
      <element name="timeout" type="xsd:int"/>
      <element name="sizeLimit" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
   <element name="lookupConceptCodesByPropertyResponse">
    <complexType>
     <sequence>
      <element maxOccurs="unbounded" name="lookupConceptCodesByPropertyReturn" type="impl:ConceptId"/>
     </sequence>
    </complexType>
   </element>

I'll attach the full WSDL as generated by Axis.

> String Array Regression causes SAXException: Found character data ...
> ---------------------------------------------------------------------
>
>          Key: AXIS-2021
>          URL: http://issues.apache.org/jira/browse/AXIS-2021
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2
>  Environment: Server - Tomcat 5.0.25 on Java 1.4.2_01 on Fedora Core 3
> Client - Axis running on Java 1.4.2_05 On Window XP SP2
>     Reporter: Dan Armbrust
>     Priority: Blocker
>  Attachments: VocabBrowser.wsdl
>
> This seems to be a serious regression bug... But maybe I'm doing something wrong...
> I was using 1.2 RC2, and everything was working for me.  Now under 1.2 final, the handling
of arrays appears broken.
> Here is the error:
> org.apache.axis.AxisFaultorg.xml.sax.SAXException: Found character data inside an array
element while deserializing
> Here is the message that it choked on:
> <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>
>    <getSupportedMatchAlgorithmsResponse xmlns="urn://hl7.org/CTSVAPI">
>      <getSupportedMatchAlgorithmsReturn xmlns:ns1="urn://hl7.org/CTSVAPI" xsi:type="ns1:ArrayOf_xsd_string">IdenticalIgnoreCase</getSupportedMatchAlgorithmsReturn>
>      <getSupportedMatchAlgorithmsReturn>StartsWithIgnoreCase</getSupportedMatchAlgorithmsReturn>
>      <getSupportedMatchAlgorithmsReturn>EndsWithIgnoreCase</getSupportedMatchAlgorithmsReturn>
>      <getSupportedMatchAlgorithmsReturn>ContainsPhraseIgnoreCase</getSupportedMatchAlgorithmsReturn>
>    </getSupportedMatchAlgorithmsResponse>
>  </soapenv:Body>
> </soapenv:Envelope>
> What it is supposed to be returning is a simple String[].
> A snippit  from the wsdl file:
>   <element name="getSupportedMatchAlgorithms">
>    <complexType/>
>   </element>
>   <element name="getSupportedMatchAlgorithmsResponse">
>    <complexType>
>     <sequence>
>      <element maxOccurs="unbounded" name="getSupportedMatchAlgorithmsReturn" type="xsd:string"/>
>     </sequence>
>    </complexType>
>   </element>
> So I don't know why that ArrayOf_xsd_string gunk is in the response.
> My build process is kind of complicated - my initial definition of the API is in IDL.
 The idl is compiled into Java.  Then, my WSDL is generated by the java2wsdl tool, using the
"-y WRAPPED"  option.
> Then, I generate java using wsdl2java tool - and I implement my API using the resulting
java classes.  One thing that I noted here, was that 1.2 rc2 generated  "ArrayOf_X" classes
 for each array object, while 1.2 final does not generate any ArrayOf_X classes.
> Finally I install the code into my Axis server, and try it out.  I can call most of the
methods in my API - but anything that returns an a String Array throws the SAXException (as
noted above) while trying to parse the response, which has stuff in it it shouldn't.
> Dan

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


Mime
View raw message