By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

Empty Arraylist from Perl Client using SOAP:Lite

P: n/a
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

Sep 13 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Vinit" <vi********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
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?
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
Sep 14 '06 #2

P: n/a
>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.
--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------
Sep 14 '06 #3

P: n/a
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????

Gaurav Vaish (www.EduJiniOnline.com) wrote:
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.
--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------
Sep 14 '06 #4

P: n/a
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 = '';


Vinit wrote:
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????

Gaurav Vaish (www.EduJiniOnline.com) wrote:
>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.
--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------
Sep 14 '06 #5

P: n/a
"Vinit" <vi********@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
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>
....
>>
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 <newListhas any relationship to
the .NET ArrayList class?

Sorry, but magic doesn't work on Windows.

John
Sep 14 '06 #6

P: n/a
> public string SendArrayList(ArrayList newList)

Look at:

http://articles.edujinionline.com/we...bservices.html

--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------
Sep 15 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.