Hi,
I have a web service developed on Axis 1.3, and it has following method.
SendTaskResponseDto sendSmsMessage(SmsRequestDto in0)
SmsRequestDto has an string array
public class SmsRequestDto implements java.io.Serializable {
private java.lang.Long projectId;
private java.lang.String user;
private java.lang.String message;
private java.lang.String[] msisdn;
private java.lang.Integer applicationId;
.........
when I try to call SendTaskResponseDto sendSmsMessage(SmsRequestDto in0)
through C#.net client it gives following exception at server
13 Oct 2008 11:03:00,015 ERROR BeanPropertyTarget - Could not convert
[Ljava.lang.String; to bean field 'msisdn[0]', type java.lang.String
13 Oct 2008 11:03:00,028 INFO EXCEPTIONS - AxisFault:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalArgumentException: array element type
mismatch
faultActor:
faultNode:
faultDetail:
{
http://xml.apache.org/axis/}stackTrace:java.lang.IllegalArgumentException:
array element type mismatch
at java.lang.reflect.Array.set(Native Method)
at
org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:195)
WSDL as follows
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
−
<complexType name="ArrayOf_soapenc_string">
−
<complexContent>
−
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="SmsRequestDto">
<sequence>
<element name="projectId" nillable="true" type="xsd:long"/>
<element name="user" nillable="true" type="xsd:string"/>
<element name="message" nillable="true" type="xsd:string"/>
<element name="msisdn" nillable="true" type="impl:ArrayOf_soapenc_string"/>
<element name="applicationId" nillable="true" type="xsd:int"/>
<element name="accountExternalId" nillable="true" type="xsd:int"/>
<element name="accountId" nillable="true" type="xsd:int"/>
<element name="originatingAddress" nillable="true" type="xsd:string"/>
<element name="originatingAddressType" nillable="true" type="xsd:int"/>
</sequence>
</complexType>
c# code
static void Main(string[] args)
{
lh.CPSWebServiceService service = new
ConsoleApplication1.lh.CPSWebServiceService();
lh.SmsRequestDto request = new
ConsoleApplication1.lh.SmsRequestDto();
string[] msisdn = new string[1];
msisdn[0] = "123456";
// msisdn[1] = "456";
request.msisdn = msisdn;
service.sendSmsMessage(request);
}
Please help me. Thank you,
Jayalal