Design Question
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebservices' list.


Guruprasad TG
Hello everybody,
    My webservices webmethod's parameter is a file name which is actually
the path to the file.
What my web method does is - It accepts the path to the file.....gets =
the
file and parses and sends back some info
Now if I want to host the service then this method wont work since my
webmethod would then try and access the file
on any remote computer and it wud fail.
    How do I go about designing this? How do I make the user submit the
file to my webmethod?

Any ideas?

Thanks in Advance,
Guru

Reply to this message...
 
    
Koen De Waele
You should look into these two specifications:
SOAP with attachments
http://www.w3.org/TR/SOAP-attachments

Dime
http://www.ietf.org/internet-drafts/draft-nielsen-dime-soap-00.txt
http://www.ietf.org/internet-drafts/draft-nielsen-dime-01.txt

Dime is (currently) a MS-only spec and brandnew, Soap with Attachments
is more vendor-neutral (and based on MIME).

Dime is afaik currently only supported in MS Soap toolkit 3.0 (beta),
Pocket SOAP and a reference implementation in .NET
SwA is supported in most of the recent SOAP toolkits.

Both specs let you upload (binary) files with SOAP. Choose wisely :-)

Hope this helps,
Koen

-----Original Message-----
From: Guruprasad TG [mailto:Click here to reveal e-mail address]
Sent: vrijdag 21 juni 2002 6:38
To: aspngwebservices
Subject: [aspngwebservices] Design Question

Hello everybody,
    My webservices webmethod's parameter is a file name which is
actually the path to the file. What my web method does is - It accepts
the path to the file.....gets the file and parses and sends back some
info Now if I want to host the service then this method wont work since
my webmethod would then try and access the file on any remote computer
and it wud fail.
    How do I go about designing this? How do I make the user submit
the file to my webmethod?

Any ideas?

Thanks in Advance,
Guru

Reply to this message...
 
    
Paul Mehner

Exposing a full pathname as an argument is not a safe practice. I would
recommend finding an alternative for security reasons.

You could upload the data to the server using the web file control and
begin processing the data upon its receipt by passing the file name (not
the full path) to your webmethod. The webmethod would look for the file
in the pre-established upload directory, and the process it from that
location.

If the contents of the file is XML, or other readable character data,
you might want to open the file on the client, assemble it into a long
string, and then send it to the server as an argument to your webservice
method (i.e. send the data itself as the method argument, rather than
the pathname as you are doing now).

--Paul

-----Original Message-----
From: Guruprasad TG [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 20, 2002 9:38 PM
To: aspngwebservices
Subject: [aspngwebservices] Design Question

Hello everybody,
    My webservices webmethod's parameter is a file name which is
actually
the path to the file.
What my web method does is - It accepts the path to the file.....gets
the
file and parses and sends back some info
Now if I want to host the service then this method wont work since my
webmethod would then try and access the file
on any remote computer and it wud fail.
    How do I go about designing this? How do I make the user submit
the
file to my webmethod?

Any ideas?

Thanks in Advance,
Guru

| [aspngwebservices] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebservices.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com