axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <...@us.ibm.com>
Subject Re: array test
Date Tue, 04 Dec 2001 13:36:20 GMT
The difference is how we deal with the "href".  I've been trying,
unsuccessfully, to reproduce the bug on a small testcase, but
on the larger case, what's happening is that the we look at:
      <doitResult href="#id0"/>
and ask it for its type.  Not seeing any "xsi:type" there we then
go to other places (like the wsdl - actually, the Call object)
to try to get the type.  A better approach would be to have
the "type-gathering" step follow the href to:
<multiRef id="id0" SOAP-ENC:root="0" xsi:type="SOAP-ENC:Array"...
so that it could see that it is just an Array.  At that point it
can see if it knows how to deserialize the elements in the
array.  I'm getting an error because the WSDL says the
return type is ArrayOfFoo and I don't have a deserializer
defined for ArrayOfFoo - nor should I need one since
the xsi:type (if we followed the href) says that its just
a SOAP-ENC:Array, not ArrayOfFoo.
A hack we put in our version of Axis is to just not throw
a fault if the element we can't deserialize has an "href".
It then falls thru to the normal code and appears to at least
sort of work.  Axis follows the "href" during the xml->java object
processing, we just need to follow it during the xml->type
determination processing as well.
-Dug



Sam Ruby/Raleigh/IBM@IBMUS on 12/04/2001 08:12:23 AM

Please respond to axis-dev@xml.apache.org

To:   axis-dev@xml.apache.org
cc:
Subject:  Re: array test



Doug Davis wrote:
>
> On your (1) you say throw an error if we don't
> understand the xsi:type -  just wanted to be clear - in my
> case I'm seeing the error because we aren't even looking
> at the xsi:type.  We don't follow the href - if we did then we'd
 >see a well-known xsi:type and the error would be avoided.

I guess I'm confused.  Below are the "bad" and "good" wire dumps.  The only
differences (other than ordering of elements) are the presence or absence
of trailing slashes in the definitions of ns1, ns2, ns3, and ns4.

So, we today we report that it is an array of things that we don't
understand.  If we followed the href, we again would say that it was an
array of things we don't understand.

Bad:

   <?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
     <doitResponse>
      <doitResult href="#id0"/>
     </doitResponse>
     <multiRef id="id0" SOAP-ENC:root="0" xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns1:foo[3]" xmlns:SOAP-ENC
   ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://test.com/
">
      <item href="#id1"/>
      <item href="#id2"/>
      <item href="#id3"/>
     </multiRef>
     <multiRef id="id3" SOAP-ENC:root="0" xsi:type="ns2:foo" xmlns:ns2="
http://test.com/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">3</i>
     </multiRef>
     <multiRef id="id2" SOAP-ENC:root="0" xsi:type="ns3:foo" xmlns:ns3="
http://test.com/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">2</i>
     </multiRef>
     <multiRef id="id1" SOAP-ENC:root="0" xsi:type="ns4:foo" xmlns:ns4="
http://test.com/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">1</i>
     </multiRef>
    </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

Good:

   <?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
     <doitResponse>
      <doitResult href="#id0"/>
     </doitResponse>
     <multiRef id="id0" SOAP-ENC:root="0" xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns1:foo[3]" xmlns:SOAP-ENC
   ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://test.com
">
      <item href="#id1"/>
      <item href="#id2"/>
      <item href="#id3"/>
     </multiRef>
     <multiRef id="id1" SOAP-ENC:root="0" xsi:type="ns2:foo" xmlns:ns2="
http://test.com" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">1</i>
     </multiRef>
     <multiRef id="id3" SOAP-ENC:root="0" xsi:type="ns3:foo" xmlns:ns3="
http://test.com" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">3</i>
     </multiRef>
     <multiRef id="id2" SOAP-ENC:root="0" xsi:type="ns4:foo" xmlns:ns4="
http://test.com" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
">
      <i xsi:type="xsd:int">2</i>
     </multiRef>
    </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

- Sam Ruby




Mime
View raw message