Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Calling Client-Side WCF Service With Type List<Of T>

Reply
Thread Tools

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

 
 
pbd22
Guest
Posts: n/a
 
      10-20-2009
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.
 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      10-20-2009

"pbd22" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
pbd22
Guest
Posts: n/a
 
      10-20-2009
On Oct 19, 8:51*pm, "Mr. Arnold" <MR. (E-Mail Removed)> wrote:
> "pbd22" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> > 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


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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Ajax Enabled WCF service and regular WCF? Cindy Lee ASP .Net 1 03-19-2010 05:59 PM
Proxy authentication problem WPF browser app calling WCF service pjb ASP .Net Web Services 0 12-09-2009 10:47 AM
AJAX enabled WCF Service Vs Standard WCF Service Simon ASP .Net 0 10-13-2009 09:13 AM
2.0 framework calling WCF service Greg ASP .Net Web Services 5 04-23-2007 07:16 PM
2.0 Framework calling WCF service. =?Utf-8?B?R3JlZw==?= ASP .Net 3 04-15-2007 01:24 PM



Advertisments