Calling Client-Side WCF Service With Type List<Of T>

P

pbd22

Hi.

I am designing a multi-file upload service that also shows upload
progress for each file.

If I was to design my WCF method as a SOAP contract, I would do
something like this:

var request = IService.UploadMethod(List<Upload> request);

But, how do I pass the parameter ""request"" of type "List<Upload>"
when I am calling the method from the client (../upload.svc/
uploadpictures/""request"")?

Help appreciated, thanks.
 
M

Mr. Arnold

pbd22 said:
Hi.

I am designing a multi-file upload service that also shows upload
progress for each file.

If I was to design my WCF method as a SOAP contract, I would do
something like this:

var request = IService.UploadMethod(List<Upload> request);

But, how do I pass the parameter ""request"" of type "List<Upload>"
when I am calling the method from the client (../upload.svc/
uploadpictures/""request"")?

Help appreciated, thanks.

I would assume Upload would just be a string of the filepath to upload.

On the client-side it would be this.

var requests = new List<String>();

requests.Add(filepath);

var cleint = new WCFservice()
client.Upload(requests);
client.close();


On server-side it would be this.

UploadMethod(List<String> requests)

foreach(var request in requests
{

unloadpic.path = request;

}






__________ Information from ESET NOD32 Antivirus, version of virus signature database 4524 (20091019) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
P

pbd22

I would assume Upload would just be a string of the filepath to upload.

On the client-side it would be this.

var requests = new List<String>();

requests.Add(filepath);

var cleint = new WCFservice()
client.Upload(requests);
client.close();

On server-side it would be this.

UploadMethod(List<String> requests)

foreach(var request in requests
{

unloadpic.path = request;

}

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4524 (20091019) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Can you do that? List<Of T> is a .NET Type, isn't it? How can you use
it in JavaScript? I just tried this and it didn't work. Also, how can
you instantiate
new WCFservice() in JS? I must be missing something here.
Illumination please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top