Hi!
We�ve got a problem here concerning the deserialization of our incoming
SOAP-messages. The ele-ments of our <ANSWER_STRING>-elements with
xsi:nil=�true� are ignored by the BeanDeserializer.
We redesigned our productive WebServices to be WS-I-conform and have
problems because of this conformity.
The Situation:
We defined our complexType �StringArray� as follows:
WSDL:
<sequence>
...
<element name="ANSWER_STRING_ARRAY" type="gns:StringArray"
nillable="true"/>
...
</sequence>
XML-Schema:
<complexType name="StringArray">
<sequence>
<element name="StringArrayItem" type="string" nillable="true"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
After an request, the Axis-Client gets an answer with three elements from
the server where the second has an attribute saying it is a null-Value:
xsi:nil=�true�.
SOAP-Answer:
<ANSWER_STRING_ARRAY>
<StringArrayItem
xmlns="http://ws.at.our.company">firstString</StringArrayItem>
<StringArrayItem xsi:nil="true" xmlns=" http://ws.at.our.company "/>
<StringArrayItem xmlns=" http://ws.at.our.company
">thirdString</StringArrayItem>
</ANSWER_STRING_ARRAY>
Up to this point everything is alright. The problem is, that the generated
AXIS-Client-Stub deserializes this SOAP-Element to:
Deserialized Form:
1.Array-Element: �firstString�
2.Array-Element: �thirdString�
The real second element, that should be a Java-String-Object with a
null-value is completely ignored.
The responsible changes for this behaviour are located in the lines of code
for the Fastpath-Nil-Checks, added to axis in Revision 1.55.4.3 (viewable
at:
http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
)
Our questions:
- Is there a way to get an array of three elements deserialized from the
above SOAP-element, so that we get the java.lang.String-Objects:
[�fist String�;
null;
�thirdString�]
?
We think the behaviour of Axis is wrong, because we defined our
StringArrayItem-elements with nilla-ble=�true�.
- Do you approve?
- If the behaviour is wrong, as we believe, how can we get it fixed?
The code:
// Fastpath nil checks...
if (context.isNil(attributes)) {
setChildValue(null, new Integer(collectionIndex++)); //new line
return null;
}
in BeanDeserializer would result in the wanted three String-Objects, but
�cause of the nature of Web-Services we do of course not want to distribute
modified Deserializers to our customers.
Thanks for your help,
Sebastian Wiehage
--
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl