Web Service Logging To File Problem (file in use)

I have a web service that does a bunch of processing and when complete
I would like it to write to a text file log in IsolatedStorage. 
I'm using the FileStream and StreamWriter and am getting the following
error periodically:

The process cannot access the file "C\inetpub\wwwroot\serv\IsolatedStorage\RequestLog.txt" because it is being used by another process.

The code looks like this:
        Dim fStreamWriter As StreamWriter
        Dim fsFile As FileStream

        fsFile = New FileStream(ConfigurationSettings.AppSettings(GlobalConstants.REQUEST_LOG_FILE_TXT), _
                        FileMode.Append, FileAccess.Write, FileShare.Write)

        fStreamWriter = New StreamWriter(fsFile)

I've tried putting Application.Lock and using a Mutex around the statements, however, the same error occurs.

    1. With FileMode.Append and FileShare.Write set shouldn't the file be opened as sharable?
    2. Shouldn't the Application.Lock and Mutex work to prevent and queue requests to this resource (I/O)?
    3. Does anyone have any other ideas on how to accomplish this?

Thanks in advance for your ideas!

Kurt Stricker

Twin Bridge Consulting, Inc.


9/15/2005 2:38:11 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 44

Try a fStreamWriter.Flush() before the fStreamWriter.Close(). Might not do the trick, but worth a shot.
All I know is that I don't know nothin!
9/15/2005 4:41:56 PM
We tried .flush() and it didn't make any difference.  Thanks for the reply.

Kurt Stricker

Twin Bridge Consulting, Inc.


9/15/2005 4:49:57 PM
Well, I've done this a few times, but without a FileStream.

I have done:

StreamWriter sw  = new StreamWriter(path, true);

Works like a champ!

All I know is that I don't know nothin!
9/15/2005 8:55:58 PM
We tried the straight StreamWriter initially and it caused the same
problem.  How busy was this web service it worked on?  We're
trying to call our webservice about 200 times within a minute using
async calls. 

Kurt Stricker

Twin Bridge Consulting, Inc.


9/16/2005 3:01:53 PM
It was definately not that busy. I guess I am of no help at all....sorry :(
All I know is that I don't know nothin!
9/16/2005 3:43:38 PM

Similar Artilces:

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

change a web reference to a web service in the config file of an object used by a windows service
In my solution (visual studios 2005), I have a windows service and a business object.  The business object has a web reference to a web service.  I maid the web reference dynamic and it created an applicationSettings section in the appconfig:<configuration>           <applicationSettings>        <Objects.Properties.Settings>            <setting name="Objects_LookupService_auth"        &nbs...

web service call failed: 500 using ajax hovermenu and web service with ascx file
I am using a hovermenu extender on an image button. The hovemenu extender calls a web service and returns back information that I write to the panel that displays. A portion of the code is below. This works when the Page is an aspx page but when I move it to an ascx page I get web service call failed. I do have the ascx page in a folder called controls/pages off of the root but both the default.aspx page and the bedinfo.asmx page are on the root. I don't think I have a path problem. I can include more complete code, there are actually 50 images with 50 hovermenu extenders and one p...

How to send an XML file to a Web Service (that records the XML file to HD)
I did this because I wanted to send an XML file to another computer, whether it be next to the one I’m using  or in another country. You will need to adapt my example in order for it to work as you want it. All I demonstrate here is that it is possible to send an XML file to another computer using XML Web Services. Let me know if it works for you. The code assumes you can use Visual Studio. Make the Web Service 1. Make a new project, choosing to make a Web Service. 2. In the code behind-page, place the code below. 3. Build the Web Service. Code: <WebMethod()>...

Xml file mapper using Web Service
Hi all, I am tasked with creating a web service that maps a number of files to a relational database.  I have a good idea of how I might do this but need to make sure that a list of files get mapped to the database or else they are all rolled back.  Here is the scenario of what should happen. 1. Call an initializing method with the list of files to process as a parameter 2. This method would return a unique identifier to the caller 3. Everytime the caller calls a mapping function also pass the identifier as a parameter 4. If a mapping function fails call a rollback function wit...

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

web services used to convert Word files to PDF files
My professor asked me to design a web services which convert Microsoft's word files to PDF files. by use VS.NET and Windows Server 2003. After I installe Adode Acrobat 6.0 Professional, I can find some Acrobat components, Acrobat Distiller, Acrobat Web Capture 1.0 Type Library, etc. Please tell me which one can be used for my project and how to use it. Or please tell me popular free components of third parts. Thanks!...

how to create web service that create xml files availible for web application
Hi epxerts im new in web service. I have a web link which contains nothing when you visit that web link. But when you view the source it will show the xml source in it. I want to create that xml file through web service and make these xml files availible for my application. Best RegardsShaukat Waqar...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

Problem calling Web Service using the DynamicPopulate Extender
Hi, I'm quite new to ASP.Net AJAX so please forgive my ignorance.  I have downloaded and installed the RC1 version and am following through some of the tutorial videos.  I am having a problem with the Dynamic Populate Extender example.  I have created some asp controls with onclick events calling a javascript function.  From there I am attempting to use a dynamic populate extender control to call a web service - it's a function declared on that ASPX page as the tutorial explains in necessary and decorated with the System.Web.Services.WebMEthod AND System.Web.Script.Serv...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ So no ...

Web Service Web.Config File
I have a web service that logs results to a database. Where should I store the connection string so I can change it w/out re-compiling? Initially I tried storing it in the web.config file under the appSettings element. However, after I connected to the web service from a client, the webservice pulled the web.config file information from the client's machine. Do I need to create a custom configuration object and serialize it to file on the web service's machine OR is there a way to tell the web service to read its web.config file and not the clients?Thanks! I figured it out. ...

Exposing xml file to client using a web service method
I need to write a web service which will have a method to authenticate user,if user is authenticated then i will pull data from my database server using dataset.Now the task is to make the data into an xml file and if the user is authenticated i need to show the file to client.So that,the client will parse the file without saving that. i can create an xml file using daset.writexml(>>>>) But i am facing problem how can i return the file to client. <webmethod _> public function xxx() as ????????   dataset.writexml("123.xml") return ??????? end funct...

log all web services request & response in XML file
Dear All;  Can you help me.  How to log all web services requests & responses in XML file or database table (XML Format) over vb codeBest regards,Mohammed Al-AtariSr. System Analyst - Team LeaderGSM Tel. : (965) 9 7150054My Space: http://al-atari.spaces.live.com/ You might want to say which web services framework you are using... If you are using the old ASMX services, then you should look in the MSDN documentation for their example about SOAP Extensions. The example is an extension that logs the request and response.John Saunders | MVP – Connected System Dev...

Web resources about - Web Service Logging To File Problem (file in use) - asp.net.xml-web-services

United States Department of Health and Human Services - Wikipedia, the free encyclopedia
The United States Department of Health and Human Services ( HHS ) is a Cabinet department of the United States government with the goal of protecting ...

Sprint Dials Up Conversocial for Customer Service via Facebook Messenger
Wireless giant Sprint teamed up with Conversocial , a cloud-based social customer service solution and Facebook Marketing Partner , to provide ...

F5: MKM Cuts Estimates as Google et al. Make ‘ADC-as-a-Service’
... ) Google division and other cloud providers are increasingly developing software that displaces what the company does. “Additional Cloud Service ...

THE FINTECH ECOSYSTEM REPORT: The fight-or-flight moment in financial services is here
Technology is upending workflow and processes in the financial services industry. Tasks once handled with paper money, bulky computers, and human ...

Secret Service agent's gun, badge, ID card stolen near White House
CBS News confirmed the agent went discovered the missing items from his vehicle on Monday

Google expands Home Services Ads
Google is expanding its Home Services Ads throughout the Bay Area in a bid to capture more of the market.

First on CNN: Secret Service agent's gun, badge stolen near White House
CNN First on CNN: Secret Service agent's gun, badge stolen near White House CNN Honolulu, Hawaii (CNN) A Secret Service agent's gun, badge, ...

Secret Service agent's gun, badge stolen. Agency 'in crisis'?
Christian Science Monitor Secret Service agent's gun, badge stolen. Agency 'in crisis'? Christian Science Monitor Underlying the agency's ...

STOLEN: Secret Service Agent’s Gun, Flash Drive, Badge, Radio, Handcuffs
STOLEN: Secret Service Agent’s Gun, Flash Drive, Badge, Radio, Handcuffs

Taiwan market: Taiwan Secom provides retail management services via cooperation with Microsoft
Taiwan Secom, the largest residential/commercial security service provider in Taiwan, on December announced cooperation with Microsoft to provide ...

Resources last updated: 12/23/2015 12:47:58 PM