Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

problem with String [] in axis 1.3 and .net client

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 {
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 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:
faultCode: {}Server.userException
faultString: java.lang.IllegalArgumentException: array element type mismatch
{}stackTrace:java.lang.IllegalArgumentException: array element type mismatch
at java.lang.reflect.Array.set(Native Method)
at org.apache.axis.utils.BeanPropertyDescriptor.set(

WSDL as follows

<import namespace=""/>

<complexType name="ArrayOf_soapenc_string">


<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>

<complexType name="SmsRequestDto">
<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"/>

c# client 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;


This is the C# request which is not working,(shown in tcp monitor)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:soapenc="" xmlns:tns="" xmlns:types="" xmlns:xsi="" xmlns:xsd="">
<soap:Body soap:encodingStyle="">
<tns:sendSmsMessage><in0 href="#id1" />
<q1:SmsRequestDto id="id1" xsi:type="q1:SmsRequestDto" xmlns:q1="">
<projectId xsi:nil="true" /><user xsi:nil="true" />
<message xsi:nil="true" />
<msisdn href="#id2" />
<applicationId xsi:nil="true" />
<accountExternalId xsi:nil="true" />
<accountId xsi:nil="true" />
<originatingAddress xsi:nil="true" />
<originatingAddressType xsi:nil="true" />

<soapenc:Array id="id2" soapenc:arrayType="xsd:string[1]">

but for following Axis 1.3 client request it works fine

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="" xmlns:xsd="" xmlns:xsi=""><soapenv:Body>
<ns1:sendSmsMessage soapenv:encodingStyle="" xmlns:ns1="">
<in0 href="#id0"/>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="" xsi:type="ns2:SmsRequestDto" xmlns:soapenc="" xmlns:ns2="">
<projectId href="#id1"/>
<user xsi:type="xsd:string" xsi:nil="true"/>
<message xsi:type="xsd:string" xsi:nil="true"/>
<msisdn soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
<ns3:item xsi:type="xsd:string" xmlns:ns3="">123456789</ns3:item>
<applicationId xsi:type="xsd:int" xsi:nil="true"/>
<accountExternalId xsi:type="xsd:int" xsi:nil="true"/>
<accountId xsi:type="xsd:int" xsi:nil="true"/>
<originatingAddress xsi:type="xsd:string" xsi:nil="true"/>
<originatingAddressType xsi:type="xsd:int" xsi:nil="true"/>

<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="" xsi:type="xsd:long" xmlns:soapenc="">

Please help me. Thank you,

Let me tell you a story about a man named Jed. He made this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic