Groups | Blog | Home
all groups > dotnet web services enhancements > january 2005 >

dotnet web services enhancements : inputTrace.config can't be read because it is being used by the process of aspnet_wp after it's generated by wse2.


znmaster
1/22/2005 8:27:09 PM

When I use WSE2 to secure soap messages, I add "<trace enabled="true"
input="inputTrace.config"
output="outputTrace.config"/>" to the web.config file of Webservices.
Thus the soap messages are put down in the two files of "inputTrace.config"
and "outputTrace.config".
Then I use XmlTextReader to read the file of "inputTrace.config", I get
an IOException, because the file is being used by another process. After I
manually kill the process of aspnet_wp using System Task Manager, it becomes
ok.
I want to use a piece of code to kill the process of aspnet_wp after the
file of "inputTrace.config" has been generated by wse2.
The code is like this,

System.Diagnostics.Process[] processOnComputer =
System.Diagnostics.Process.GetProcesses();
foreach ( System.Diagnostics.Process p in processOnComputer )
{
if(p.ProcessName == "aspnet_wp")
p.Kill();
}
Maybe because this program itself use aspnet_wp, it couldn't kill aspnet_wp.
In summary , I just want to use XmlTextreader to read inputTrace.config to a
textbox after the soap message is put down in the file by wse2. How can I
release the file from the control of the process of aspnet_wp and let it
read by XmlTextReader?
Please help me! Thank you!

Sidd
1/25/2005 9:48:26 AM
Hi,

You are correct in noticing that the trace files are held by ASP.NET.
This is because WSE does not load the entire trace file, write one entry and
close the trace file. This would be horribly slow for large trace files.

A simple way that I have found to reset the app-domain, is by just
touching the web.config file of the service. This causes the app domain to
reset, and voila, you don't have anything holding the trace file anymore.

As always, please do think over this more carefully. If you web service
had some state information that persisted between requests for some reason,
then resetting the app domain to read the trace file is not the best way to
go.

Thanks,

Sidd [MSFT]

[quoted text, click to view]

znmaster
1/26/2005 4:30:37 PM
Can I use code(not manually) to realize that? That's, to stop the ASPNET_wp
process, or to change the <config>section .I have to make a program to
demonstrate the content of the soap message captured in "inputTrace.config"
for my thesis. The program will run independent of VS2003IDE.
Thank you!
"Sidd" <ElCid@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ
:ehpoTYwAFHA.3376@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Sidd
1/27/2005 11:09:41 PM
The easiest way in code to do that would be to touch the web.config file.
You can just open the web.config file, do nothing and close it back to cause
the AppDomain to recycle.

Thanks,

Sidd [MSFT]


[quoted text, click to view]

znmaster
2/19/2005 9:36:36 AM
I've tried but failed.
string closefile = @"C:\Program Files\Microsoft
WSE\v2.0\Samples\CS\QuickStart\AsymmetricEncryption\Code\AsymEncryptCodeServ
ice\web.config";
FileStream fs = File.Open(closefile,FileMode.Open);
fs.Close();
Although the file web.config is closed, the files of inputTrace.config and
outputTrace.config are still controlled by ASPNET. I cant read them.

"Sidd" <ElCid@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ
:eb#JXhQBFHA.3492@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

znmaster
2/19/2005 9:38:22 AM
I've tried but failed.
string closefile = @"C:\Program Files\Microsoft
WSE\v2.0\Samples\CS\QuickStart\AsymmetricEncryption\Code\AsymEncryptCodeServ
ice\web.config";
FileStream fs = File.Open(closefile,FileMode.Open);
fs.Close();
Although the file web.config is closed, the files of inputTrace.config and
outputTrace.config are still controlled by ASPNET. I cant read them.

"Sidd" <ElCid@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ
:eb#JXhQBFHA.3492@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button