Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
znmaster - 22 Jan 2005 12:27 GMT
  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 - 25 Jan 2005 17:48 GMT
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]

>    When I use WSE2 to secure soap messages, I add "<trace enabled="true"
> input="inputTrace.config"
[quoted text clipped - 22 lines]
> read by XmlTextReader?
>    Please help me! Thank you!
znmaster - 26 Jan 2005 08:28 GMT
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...
> Hi,
[quoted text clipped - 46 lines]
> > read by XmlTextReader?
> >    Please help me! Thank you!
Sidd - 28 Jan 2005 07:09 GMT
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]

> 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
[quoted text clipped - 62 lines]
> > > read by XmlTextReader?
> > >    Please help me! Thank you!
znmaster - 19 Feb 2005 01:36 GMT
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...
> The easiest way in code to do that would be to touch the web.config file.
[quoted text clipped - 81 lines]
> > > > read by XmlTextReader?
> > > >    Please help me! Thank you!
znmaster - 19 Feb 2005 01:38 GMT
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...
> The easiest way in code to do that would be to touch the web.config file.
[quoted text clipped - 81 lines]
> > > > read by XmlTextReader?
> > > >    Please help me! Thank you!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.