|
Hi,
I use Axis server 1.1 and I have a service with some methods working with
complex beans. An example of such a bean is one containing an array of other
beans and some basic types.
Here is an example of such a class:
public class Differences
{
private Long ID_PRODUSEA;
private Variant[] Fields;
.
.
.
}
public class Variant implements java.io.Serializable {
private java.util.Calendar dateValue;
private java.lang.Double doubleValue;
private java.lang.Integer integerValue;
private java.lang.String key;
private java.lang.Long longValue;
private java.lang.String stringValue;
private ro.csean.andrei.TextLanguage[] textLanguageValue;
private java.lang.String type;
.
.
.
}
public class TextLanguage implements java.io.Serializable {
private java.lang.String language;
private java.lang.String text;
.
.
.
}
Using WASP C++ in the client side, a want to build an array of Differences
and pass it to the service using an simple echo_method. The strange part
comes into play now: The Fields array from each of the Differences class hit
the service method with NULL value.
The service method is:
public String echo_ArrayOfDifferences(Differences[] test_Differences)
{
String result=new String();
if(test_Differences==null)
{
result+="test_Differences[]='null'";
return result;
}
for(int i=0;i<test_Differences.length;i++)
{
if(test_Differences[i]==null)
result+="test_Differences["+i+"]='null'\n";
else
result+="test_Differences["+i+"]: "+test_Differences[i].toString()+
\n";
}
return result;
}
The soap envelope for this call is:
<SOAP-ENV:Envelope 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" xmlns:SE=" http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body SOAP-ENV:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"> <ns0:echo_ArrayOfDifferences xmlns:ns0=" http://localhost:8090/"> <test_Differences SE:arrayType="ns0:Differences[2]"> <item xsi:type="ns0:Differences"> <ID_PRODUSEA xsi:type="xsd:long">1087493</ID_PRODUSEA> <fields SE:arrayType="ns0:Variant[2]"> <item xsi:type="ns0:Variant"> <dateValue xsi:nil="1"/> <doubleValue xsi:type="xsd:double">0</doubleValue> <integerValue xsi:type="xsd:int">0</integerValue> <key xsi:type="xsd:string">COD_PSTATUS</key> <longValue xsi:type="xsd:long">0</longValue> <stringValue xsi:type="xsd:string">REJ</stringValue> <textLanguageValue xsi:nil="1"/> <type xsi:type="xsd:string">STRING</type> </item> <item xsi:type="ns0:Variant"> <dateValue xsi:nil="1"/> <doubleValue xsi:type="xsd:double">0</doubleValue> <integerValue xsi:type="xsd:int">0</integerValue> <key xsi:type="xsd:string">NR_GTIN_BZ</key> <longValue xsi:type="xsd:long">111</longValue> <stringValue xsi:nil="1"/> <textLanguageValue xsi:nil="1"/> <type xsi:type="xsd:string">LONG</type> </item> </fields> </item> <item xsi:type="ns0:Differences"> <ID_PRODUSEA xsi:type="xsd:long">1087494</ID_PRODUSEA> <fields SE:arrayType="ns0:Variant[2]"> <item xsi:type="ns0:Variant"> <dateValue xsi:nil="1"/> <doubleValue xsi:type="xsd:double">0</doubleValue> <integerValue xsi:type="xsd:int">0</integerValue> <key xsi:type="xsd:string">COD_PSTATUS</key> <longValue xsi:type="xsd:long">0</longValue> <stringValue xsi:type="xsd:string">REJ</stringValue> <textLanguageValue xsi:nil="1"/> <type xsi:type="xsd:string">STRING</type> </item> <item xsi:type="ns0:Variant"> <dateValue xsi:nil="1"/> <doubleValue xsi:type="xsd:double">0</doubleValue> <integerValue xsi:type="xsd:int">0</integerValue> <key xsi:type="xsd:string">NR_GTIN_BZ</key> <longValue xsi:type="xsd:long">222</longValue> <stringValue xsi:nil="1"/> <textLanguageValue xsi:nil="1"/> <type xsi:type="xsd:string">LONG</type> </item> </fields> </item> </test_Differences> </ns0:echo_ArrayOfDifferences> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
|