Main Page | Report this Page
.NET DotNet Forum Index  »  ASP.NET - Webservices Forum  »  Calling Client-Side WCF Service With Type List...
Page 1 of 1    

Calling Client-Side WCF Service With Type List...

Author Message
pbd22...
Posted: Mon Oct 19, 2009 3:55 pm
Guest
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.
 
Mr. Arnold...
Posted: Mon Oct 19, 2009 9:51 pm
Guest
"pbd22" <dushkin at (no spam) gmail.com> wrote in message
news:7a9a5cb7-4c7c-475d-83b6-6c6b88652037 at (no spam) d34g2000vbm.googlegroups.com...
Quote:
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
 
pbd22...
Posted: Tue Oct 20, 2009 4:02 am
Guest
On Oct 19, 8:51 pm, "Mr. Arnold" <MR. Arn... at (no spam) Arnold.com> wrote:
Quote:
"pbd22" <dush... at (no spam) gmail.com> wrote in message

news:7a9a5cb7-4c7c-475d-83b6-6c6b88652037 at (no spam) d34g2000vbm.googlegroups.com...

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?
 
Mr. Arnold...
Posted: Tue Oct 20, 2009 8:40 am
Guest
pbd22 wrote:
Quote:
On Oct 19, 8:51 pm, "Mr. Arnold" <MR. Arn... at (no spam) Arnold.com> wrote:
"pbd22" <dush... at (no spam) gmail.com> wrote in message

news:7a9a5cb7-4c7c-475d-83b6-6c6b88652037 at (no spam) d34g2000vbm.googlegroups.com...

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;

}


Can you do that? List<Of T> is a .NET Type, isn't it?

And string, int, double, etc, etc variable types are objects.

http://dotnetperls.com/list

Quote:
How can you use
it in JavaScript?

By using Ajax.NET, which you can send a collection of objects up to
JavaScript on a callback from a .NET class, like a code behind file
aspx.cs of an empty no Web controls on the aspx form or other .Net class
types.


Quote:
I just tried this and it didn't work. Also, how can
you instantiate
new WCFservice() in JS? I must be missing something here.

http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html

I myself would be going through an MVP Model View Presenter to the WCF
Web service, and the MVP would be called by a .Net class on a callback
to JavaScript. That's just me and how I would do it.
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Mon Dec 07, 2009 9:54 pm