You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Alexander Gubin <ag...@yahoo.com> on 2004/10/13 07:14:00 UTC

name="id" and SOAP message parsing problem

Hi all,

I am using Axis 1.2 Beta on a client to parse
webservice response. JDK1.4.2, Linux RedHat9.

Webservice is Java Axis based. 
I wrote the WSDL manually and provided references to
the schema from WSDL. Then generated client code with
WSDL2Java.

I construct a request, webservice receives it and
constructs a response. Response is valid SOAP XML, I
can see it in TCPmon.

The problem:  Schema has multiple elements with
attributes whose name is "id", e.g.:

 <xs:element name="AirPrice">
       <xs:complexType>
            <xs:sequence>
               <xs:element ref="NoteRef" minOccurs="0"
maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="id" type="typeRef"
use="required"/>
       </xs:complexType>     
</xs:element>
<xs:element name="NoteRef">
        <xs:attribute name="id" type="xs:string"
use="required"/>
</xs:element>

... etc
                
When I try to construct an object from SOAP request
AND id in AirPrice is the same as id in NoteRef (e.g.
both 1 or both 2) I get the following exception:

java.lang.IllegalArgumentException: argument type
mismatch
        at
org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:149)
 at
org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:255)
        at
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:515)
        at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1077)
        at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1138)
        at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:199)
        at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:342)
        at
org.apache.axis.client.Call.invoke(Call.java:2420)
        at
org.apache.axis.client.Call.invoke(Call.java:2319)
        at
org.apache.axis.client.Call.invoke(Call.java:1776)

....

after checking and rechecking XML validity and playing
with id values, I tried changing all "id"s to "key"s
(name="key" instead of name="id" in schema) and
parsing worked flawlessly.

Is "id" is somewhat reserved word for Axis??? Or maybe
it somehow globally referenced??? It this a BUG?

Thanks for your help

Sincerely,

Alexander Gubin


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com