Hi Egor;
Can you please create a JIRA , this is a bug in Axis2.

Thanx
Deepal

Egor Samarkhanov wrote:

>Hello !
>
>I created a simple service with the following method:
>
>public String[] testStringArrayWithNulls( String[] sarray )
>{
>  return sarray;
>}
>
>Then I generated WSDL file (Java2WSDL) and got the following types in
>it:
>
><xs:element name="testStringArrayWithNulls">
>  <xs:complexType>
>    <xs:sequence>
>      <xs:element minOccurs="0" type="xs:string" name="sarray" 
> maxOccurs="unbounded"/>
>    </xs:sequence>
>  </xs:complexType>
></xs:element>
><xs:element name="testStringArrayWithNullsResponse">
>  <xs:complexType>
>    <xs:sequence>
>      <xs:element minOccurs="0" type="xs:string" name="return" 
> maxOccurs="unbounded"/>
>    </xs:sequence>
>  </xs:complexType>
></xs:element>
>
>
>Then I added nillable="true" attribute manually to each item (to make .NET send
>nulls in SOAP), so the types are:
>
><xs:element name="testStringArrayWithNulls">
>  <xs:complexType>
>    <xs:sequence>
>      <xs:element minOccurs="0" type="xs:string" name="sarray" 
> maxOccurs="unbounded" nillable="true"/>
>    </xs:sequence>
>  </xs:complexType>
></xs:element>
><xs:element name="testStringArrayWithNullsResponse">
>  <xs:complexType>
>    <xs:sequence>
>      <xs:element minOccurs="0" type="xs:string" name="return" 
> maxOccurs="unbounded"  nillable="true"/>
>    </xs:sequence>
>  </xs:complexType>
></xs:element>
>
>Then I deployed this service and tested it with a simple .NET client
>that sends the following array (the operation is document/literal):
>
>[null, "str", null, "str", null]
>
>The SOAP message from .NET is as follows:
>
><?xml version='1.0' encoding='utf-8'?>
><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; 
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>  <soap:Body>
>    <testStringArrayWithNulls xmlns="http://org.apache.axis2/xsd";>
>      <sarray xsi:nil="true" />
>      <sarray>str</sarray>
>      <sarray xsi:nil="true" />
>      <sarray>str</sarray>
>      <sarray xsi:nil="true" />
>    </testStringArrayWithNulls>
>  </soap:Body>
></soap:Envelope>
>
>But for some reason my service gets:
>
>["", "str", "", "str", ""]
>
>All null values in the array are replaced with empty strings :(
>
>So, I have two questions:
>
>1. Why Axis replaces nulls with empty strings when the nulls are
>   marked with xsi:nil="true" attribute in SOAP message? Is this a
>   bug?
>
>2. Why Java2WSDL doesn't add nillable="true" to Object array elements
>   automatically?
>
>------------------------------------
>Best regards,
>Egor Samarkhanov ([EMAIL PROTECTED])
>Actimind, Inc.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to