Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Current directory for Web Service

Reply
Thread Tools

Current directory for Web Service

 
 
Alwin D
Guest
Posts: n/a
 
      06-12-2007
Hello,

How can I get the current directory of Web Service?
Usually my Web services are under Inetpub directory.

I would like to write trace file into that place.
If I try to trace e.g. C:\Temp directory I usually havenšt got
permissions to write the trace file.

So, do I have special Permissions for wrting trace file from Web Service or
can I query Web Service's default Assemply location and write there?

Cheers


 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-12-2007
"Alwin D" <(E-Mail Removed)> wrote in message
news:f4md6k$ibl$(E-Mail Removed)...
> Hello,
>
> How can I get the current directory of Web Service?
> Usually my Web services are under Inetpub directory.
>
> I would like to write trace file into that place.
> If I try to trace e.g. C:\Temp directory I usually havenšt got
> permissions to write the trace file.
>
> So, do I have special Permissions for wrting trace file from Web Service
> or
> can I query Web Service's default Assemply location and write there?


Please don't cross-post. Post in a single newsgroup.

Just like any other process, the process running your web service needs
appropriate permissions to access any file system resource. It does not
necessarily have any special permissions to the directory its assembly lives
in.

You can try Request.PhysicalApplicationPath and see if that works for you.
You then have to make sure you have rights to write there.
--
John Saunders [MVP]


 
Reply With Quote
 
 
 
 
Alwin D
Guest
Posts: n/a
 
      06-12-2007
Some typos from keyboard ...
But code

string AppPath = HttpContext.Current.Request.PhysicalApplicationPat h;

works well,

Cheers

"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
news:(E-Mail Removed)...
> "Alwin D" <(E-Mail Removed)> wrote in message
> news:f4md6k$ibl$(E-Mail Removed)...
>> Hello,
>>
>> How can I get the current directory of Web Service?
>> Usually my Web services are under Inetpub directory.
>>
>> I would like to write trace file into that place.
>> If I try to trace e.g. C:\Temp directory I usually havenšt got
>> permissions to write the trace file.
>>
>> So, do I have special Permissions for wrting trace file from Web Service
>> or
>> can I query Web Service's default Assemply location and write there?

>
> Please don't cross-post. Post in a single newsgroup.
>
> Just like any other process, the process running your web service needs
> appropriate permissions to access any file system resource. It does not
> necessarily have any special permissions to the directory its assembly
> lives in.
>
> You can try Request.PhysicalApplicationPath and see if that works for you.
> You then have to make sure you have rights to write there.
> --
> John Saunders [MVP]
>
>



 
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
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Current directory for Web Service Alwin D ASP .Net 0 06-12-2007 03:19 PM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM



Advertisments