Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2006

Tip: Looking for answers? Try searching our database.

Empty Arraylist from Perl Client using SOAP:Lite

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinit - 14 Sep 2006 00:12 GMT
Hi

I am passing an arraylist to a c#/.net webmethod from a perl client
using soap:lite. The trace shows the elements in the xml request. The
arraylist input in the webmethod however does not contain any values
and is empty.
It works fine with arrays....but NOT arraylists....does anyone know
WHY? and HOW TO SOLVE THIS ISSUE?

Regards,
Vinit
John Saunders - 14 Sep 2006 02:01 GMT
> Hi
>
[quoted text clipped - 4 lines]
> It works fine with arrays....but NOT arraylists....does anyone know
> WHY? and HOW TO SOLVE THIS ISSUE?

Does Perl have an ArrayList data type? If not, then I don't think you're
passing an ArrayList.

Please give us some details, as we cannot guess what the problem is.

John
Gaurav Vaish (www.EduJiniOnline.com) - 14 Sep 2006 05:40 GMT
>> I am passing an arraylist to a c#/.net webmethod from a perl client
>> using soap:lite. The trace shows the elements in the xml request. The
>> arraylist input in the webmethod however does not contain any values
>> and is empty.
>> It works fine with arrays....but NOT arraylists....does anyone know
>> WHY? and HOW TO SOLVE THIS ISSUE?

Have the WSDL?
Perl does not have ArrayList... :D

The issue is only with deserialization.

Signature

Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------

Vinit - 14 Sep 2006 17:17 GMT
Sorry my bad....I meant I am passing things like this from my perl
client

print $seperator;
$name   = "SendArrayList";
$params = {newList => [1,'index'] };
$xpath  = "";
@ret = $test->ExecSoapMethod($name, $params, $xpath);
print Dumper($ret[1]), "\n";

the .Net webmethod is:
[WebMethod]
    public string SendArrayList(ArrayList newList)
     {
        if (newList==null)
           return "Null List!";
        StringBuilder sb=new StringBuilder();
        ArrayList list = new ArrayList();
        IEnumerator enumList = newList.GetEnumerator();
        while(enumList.MoveNext())
        {
           list.Add(enumList.Current.ToString());
           sb.Append(enumList.Current.ToString());
        }

        return sb.ToString();
     }

But it always returns an empty string the...arrayList if always
empty....WHY????

> >> I am passing an arraylist to a c#/.net webmethod from a perl client
> >> using soap:lite. The trace shows the elements in the xml request. The
[quoted text clipped - 14 lines]
> http://articles.edujinionline.com/webservices
> -------------------
Vinit - 14 Sep 2006 17:20 GMT
And the trace mite help:

==============================================================================
POST http://localhost/TestWebService/Service1.asmx
Accept: text/xml
Accept: multipart/*
Content-Length: 527
Content-Type: text/xml; charset=utf-8
SOAPAction: http://xxxx/SendArrayList

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://sch
emas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmln
s:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><SendArrayList
xmlns="http://www.xxxx"><newList><int>1</int><string
>index</string></newList></SendArrayList></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Connection: close
Date: Wed, 13 Sep 2006 23:37:22 GMT
Server: Microsoft-IIS/5.1
Content-Length: 367
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 13 Sep 2006 23:37:22 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
X-AspNet-Version: 1.1.4322
X-Powered-By: ASP.NET

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchem
a-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><SendArrayListResponse
xmlns="http://www.xxxx"><SendArr
ayListResult /></SendArrayListResponse></soap:Body></soap:Envelope>

$VAR1 = '';

> Sorry my bad....I meant I am passing things like this from my perl
> client
[quoted text clipped - 45 lines]
> > http://articles.edujinionline.com/webservices
> > -------------------
John Saunders - 14 Sep 2006 17:29 GMT
> And the trace mite help:
>
[quoted text clipped - 15 lines]
> xmlns="http://www.xxxx"><newList><int>1</int><string
>>index</string></newList></SendArrayList></SOAP-ENV:Body></SOAP-ENV:Envelope>
...

>> the .Net webmethod is:
>> [WebMethod]
>>      public string SendArrayList(ArrayList newList)
>>       {
...
>>       }
>>
>> But it always returns an empty string the...arrayList if always
>> empty....WHY????

Because you didin't pass it an ArrayList!!!!

How do you expect .NET to know that your <newList> has any relationship to
the .NET ArrayList class?

Sorry, but magic doesn't work on Windows.

John
Gaurav Vaish (www.EduJiniOnline.com) - 15 Sep 2006 02:43 GMT
>>      public string SendArrayList(ArrayList newList)

Look at:

http://articles.edujinionline.com/webservices/2006/05/howto-using-arrays-in-webs
ervices.html


Signature

Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.