HighTechTalks DotNet Forums  

Download file with in a web service and use it for furthur processing

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss Download file with in a web service and use it for furthur processing in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
apondu
 
Posts: n/a

Default Download file with in a web service and use it for furthur processing - 04-03-2007 , 06:39 AM






Hi,
I am new to web services and i am facing a problem.

I am interested in downloading some file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in the web service which i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code


link : http://www2.parc.com/csl/members/woo...f-WWW5-WWW.pdf

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);



But if i try to achieve the same thing in web service using c#.net
with the following code i am not able to do it.

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,Server.MapPath(fileName));

can some one suggest me how to achieve the it web services.I am also
intrested in furthur performing some operation on this file for
example reading the data from the file and use it.

Thanks for the help.

This is my mail-id : apondu (AT) gmail (DOT) com

Regards,
Govardhan


Reply With Quote
  #2  
Old   
John Saunders
 
Posts: n/a

Default Re: Download file with in a web service and use it for furthur processing - 04-03-2007 , 05:13 PM






"apondu" <apondu (AT) gmail (DOT) com> wrote

Quote:
Hi,
I am new to web services and i am facing a problem.

I am interested in downloading some file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in the web service which i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code


link :
http://www2.parc.com/csl/members/woo...f-WWW5-WWW.pdf

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);



But if i try to achieve the same thing in web service using c#.net
with the following code i am not able to do it.
Could you be more specific? What problem do you have when you try it in a
web service?

John




Reply With Quote
  #3  
Old   
apondu
 
Posts: n/a

Default Re: Download file with in a web service and use it for furthur processing - 04-05-2007 , 01:29 AM



On Apr 4, 2:13 am, "John Saunders" <john.saunders at trizetto.com>
wrote:
Quote:
"apondu" <apo... (AT) gmail (DOT) com> wrote in message

news:1175596779.135238.77150 (AT) l77g2000hsb (DOT) googlegroups.com...





Hi,
I am new towebservices and i am facing a problem.

I am interested indownloadingsome file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in thewebservicewhich i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code

link :
http://www2.parc.com/csl/members/woo...1996-Woodruff-...

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);

But if i try to achieve the same thing inwebserviceusing c#.net
with the following code i am not able to do it.

Could you be more specific? What problem do you have when you try it in awebservice?

John- Hide quoted text -

- Show quoted text -
Hi,

I am getting a error message mentioning " HTTP 500 - Internal server
error "
I am doing something wrong, is it the correct procedure to achieve wht
ai am trying to.

Waiting for some help

Regards,
Govardhan



Reply With Quote
  #4  
Old   
Andrew Brook
 
Posts: n/a

Default Re: Download file with in a web service and use it for furthur processing - 04-05-2007 , 05:31 AM



Why in your WebService example do you perform a Server.MapPath on the
absolute location of the file?
Could you try without the Server.MapPath, and also make sure that the
webservice has the privelages to access to the locations.

Andrew

"apondu" <apondu (AT) gmail (DOT) com> wrote

Quote:
On Apr 4, 2:13 am, "John Saunders" <john.saunders at trizetto.com
wrote:
"apondu" <apo... (AT) gmail (DOT) com> wrote in message

news:1175596779.135238.77150 (AT) l77g2000hsb (DOT) googlegroups.com...





Hi,
I am new towebservices and i am facing a problem.

I am interested indownloadingsome file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in thewebservicewhich i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code

link :
http://www2.parc.com/csl/members/woo...1996-Woodruff-...

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);

But if i try to achieve the same thing inwebserviceusing c#.net
with the following code i am not able to do it.

Could you be more specific? What problem do you have when you try it in
awebservice?

John- Hide quoted text -

- Show quoted text -

Hi,

I am getting a error message mentioning " HTTP 500 - Internal server
error "
I am doing something wrong, is it the correct procedure to achieve wht
ai am trying to.

Waiting for some help

Regards,
Govardhan




Reply With Quote
  #5  
Old   
John Saunders
 
Posts: n/a

Default Re: Download file with in a web service and use it for furthur processing - 04-05-2007 , 12:56 PM



"apondu" <apondu (AT) gmail (DOT) com> wrote

Quote:
On Apr 4, 2:13 am, "John Saunders" <john.saunders at trizetto.com
wrote:
"apondu" <apo... (AT) gmail (DOT) com> wrote in message

news:1175596779.135238.77150 (AT) l77g2000hsb (DOT) googlegroups.com...





Hi,
I am new towebservices and i am facing a problem.

I am interested indownloadingsome file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in thewebservicewhich i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code

link :
http://www2.parc.com/csl/members/woo...1996-Woodruff-...

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);

But if i try to achieve the same thing inwebserviceusing c#.net
with the following code i am not able to do it.

Could you be more specific? What problem do you have when you try it in
awebservice?

John- Hide quoted text -

- Show quoted text -

Hi,

I am getting a error message mentioning " HTTP 500 - Internal server
error "
I am doing something wrong, is it the correct procedure to achieve wht
ai am trying to.

Waiting for some help

Regards,
Govardhan
Have you looked at this in the debugger? Please do so and tell us which .NET
call is throwing an exception, and which exact exception. If the exception
has InnerException set, then please report that as well (recursively).

John




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.