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 / December 2004

Tip: Looking for answers? Try searching our database.

SoapExtension cannot share resources properly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sridhar, S. - 29 Dec 2004 13:03 GMT
Hi all,
I am working on a project which requires webservices to log information
about requests that are sent to it. I have written a SoapExtension that logs
client information when a request is sent to the webservice.

When there are two webservices (on the same IIS machine) and both of them
have the same SoapExtension class configured on to it, only one of them can
log information (log is written to the same file - I use Log4Net to write to
the log file). If I want the second webservice to log, I have to re-start
IIS and send a request to the second webservice upon which the first
webservice will no longer log.

I have factored out Log4Net as the problem by putting a simple TextWriter
log with the same result.

My webservices config in web.config looks like this:
<webServices>
     <soapExtensionTypes>
       <add type="com.company.mi.SoapWebServiceCollector1,ws-agent,
Version=1.0.1824.25573, Culture=neutral, PublicKeyToken=e3a81a1efb72531c"
priority="1" group="0" />
     </soapExtensionTypes>
   </webServices>

What could I be doing wrong for this to happen?

Thanks for your time and patience.
Sridhar.

Sridhar, S.
sridharsa@gmail.com
Sami Vaaraniemi - 29 Dec 2004 16:09 GMT
> Hi all,
> I am working on a project which requires webservices to log information
[quoted text clipped - 21 lines]
>
> What could I be doing wrong for this to happen?

You are trying to access a shared resource (the log file) concurrently from
more than one place. This is not going to work unless you somehow control
the concurrent access.

One way is to log into a database instead of a file. In this case the
database engine will take care of concurrency issues for you.

Another way is to try and handle the concurrency yourself. Effectively, this
means that you will need to program your services so that only one of them
accesses the resource at any given time. You can use the Mutex class for
this purpose as it can provide cross-process synchronization.

Yet another way, probably the simplest one too, would be to use a separate
log file for each service. This would be the simplest solution and at the
same time you would avoid creating a potential bottle-neck.

Regards,
Sami

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.