HighTechTalks DotNet Forums  

Re: Using .NET Client To Pass ArrayList To Java WebService

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss Re: Using .NET Client To Pass ArrayList To Java WebService in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dino Chiesa [MSFT]
 
Posts: n/a

Default Re: Using .NET Client To Pass ArrayList To Java WebService - 07-08-2003 , 11:14 PM







"Ashish" <asdd (AT) hotmail (DOT) com> wrote

Quote:
Hi There,
I am having a c# client that I want to use with a java webservice. Methods
in the java service take an arraylist. Proxy classes that .net generated
only contain definition of arraylist as an object. I am wondering how to I
pass my data to the service. Has anyone of you faced a similar problem ?
yes.
solution: Don't use types that are platform specific (like java Arraylist or
Vector, or like .NET DataSet or ArrayList, etc).

On the Java side, do not expose the methods that accept an Arraylist. Or,
expose them, but don't call them from .NET. Instead, expose from java, and
call from .NET, a similar method that accepts not an arraylist but an array.

Rather than
public java.lang.String HandleMyArraylist(java.util.Arraylist alist) {
....
}

you should use
public java.lang.String HandleMyArray(MyType[] array) {
java.util.Arraylist alist= new java.util.Arraylist(array); // I
think this creates a new arraylist with the contents of the array
return HandleMyArraylist(alist);
}

Then from .NET , consume the HandleMyArray method.

cheers,

-Dino




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.