This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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# 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;
service.sendSmsMessage(request);

}

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

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://external.soap.service.cps.moota.com" xmlns:types="http://external.soap.service.cps.moota.com/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:sendSmsMessage><in0 href="#id1" />
</tns:sendSmsMessage>
<q1:SmsRequestDto id="id1" xsi:type="q1:SmsRequestDto" xmlns:q1="http://dto.service.cps.moota.com">
<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" />
</q1:SmsRequestDto>

<soapenc:Array id="id2" soapenc:arrayType="xsd:string[1]">
<Item>123456</Item>
</soapenc:Array>
</soap:Body>
</soap:Envelope>


but for following Axis 1.3 client request it works fine

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
<ns1:sendSmsMessage soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.service.cps.moota.com">
<in0 href="#id0"/>
</ns1:sendSmsMessage>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SmsRequestDto" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://dto.service.cps.moota.com">
<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="http://webservice.clientprovisioning.moota.com">123456789</ns3:item>
</msisdn>
<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>

<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
10</multiRef>
</soapenv:Body></soapenv:Envelope>




Please help me. Thank you,

Jayalal
 
A feeble attempt to tell you about our stuff that makes us money
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!