473,791 Members | 2,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SoapExtension cannot share resources properly

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>
<soapExtensionT ypes>
<add type="com.compa ny.mi.SoapWebSe rviceCollector1 ,ws-agent,
Version=1.0.182 4.25573, Culture=neutral , PublicKeyToken= e3a81a1efb72531 c"
priority="1" group="0" />
</soapExtensionTy pes>
</webServices>

What could I be doing wrong for this to happen?

Thanks for your time and patience.
Sridhar.

Sridhar, S.
sr*******@gmail .com
Nov 23 '05 #1
1 1250

"Sridhar, S." <sr*******@gmai l.com> wrote in message
news:ey******** ******@TK2MSFTN GP15.phx.gbl...
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>
<soapExtensionT ypes>
<add type="com.compa ny.mi.SoapWebSe rviceCollector1 ,ws-agent,
Version=1.0.182 4.25573, Culture=neutral , PublicKeyToken= e3a81a1efb72531 c"
priority="1" group="0" />
</soapExtensionTy pes>
</webServices>

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
Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1563
by: Steven.Dahlin | last post by:
Is there a simple example of using SoapExtension with a Winforms Client that exist as a complete project? Not just fragments of code but something all tied together into one VS project? I am trying to get a SoapExtension to execute but for the life of me I cannot get it working and all the discussions in the MS sites and the Web in general give everything in bits and pieces. Thanks, Steve
1
3268
by: Steven.Dahlin | last post by:
I am trying to execute a soap extension with a WinForm client accessing a Web Service. I have created a application configuration which includes the following: <configuration> <system.web> <webServices> <soapExtensionTypes> <add type="mpa.TraceExtension,mpa" priority="1" group="0" /> </soapExtensionTypes>
3
3611
by: Trevor Pinkney | last post by:
Hi, Is it possible to reference a custom SoapExtension instance from within a WebMethod? I have a SoapExtension used by several web-services for generic logging. The SoapExtension logs the ServiceId, Soap Request, Start Time, End Time etc. to the database. I need to get the Id of the row the SoapExtension inserts into the database from within the Web Method. (The web method sends a
0
1280
by: Symon | last post by:
I've got a web service project that was built under VS 2003 which has a SoapExtension in the project. The SoapExtension is registered in the <soapExtensionTypes> element of the web.config and has worked fine for some time. Recently we tryed to update the project to VS 2005 and run it under ASP.NET 2.0, but now we get a compile time exception: "The value of the property 'type' cannot be parsed. The error is: Could not load file or...
0
1737
by: thatsMaBoy | last post by:
Hi, I have a VB.NET 2003 web service client (EXE) that makes use of a SOAPExtension class. The client calls a web service that returns a SOAP message containing MIME encoded files. The SOAPExtension intecepts the SOAP message and extracts the MIME, before passing on the rest of the SOAP message to the client so it can process the remainder of the data within the SOAP message. My problem is that I have taken over the project from a...
1
1133
by: Mike Fiedler | last post by:
I have a SoapExtension that needs to query the WSDL port namespace and operation namespace for the current message. As far as I can tell, the only namespace info available in the SoapMessage object is on the Action property. This maps to the namespace property on the soapAction property of the operation element. For VS-generated web services this is OK - the overall target namespace and the namespace on the soapAction will usually be...
10
2222
by: Andy Kendall | last post by:
I have a problem accessing my custom SoapHeader from a SoapExtension. My extension has no compile time reference to the class derived from SoapHeader, so how can cast it into a SoapHeader of the correct type? Thanks, Andy
1
1464
by: kyus94 | last post by:
I am working on soapextension that compresses soap message. I am stuck at only one stage now. When I get response from webservice....on client at -BeforeDeserialize stage when I try to copy original or old stream to temp stream so that I can de compress it I get 'Stream dose not support seek operation' error. Has any one come across smilar issue ...that while altering stream you could not capture it properly when client recieves it from...
8
4044
by: sheldoncs | last post by:
System.InvalidOperationException was unhandled Message="Client found response content type of 'text/plain; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'd:\logFile.txt' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10155
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.