473,468 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Create 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>
<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.
sr*******@gmail.com
Nov 23 '05 #1
1 1233

"Sridhar, S." <sr*******@gmail.com> wrote in message
news:ey**************@TK2MSFTNGP15.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>
<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?


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
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...
1
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>...
3
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...
0
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...
0
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...
1
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...
10
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...
1
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...
8
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: --...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
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...
0
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...
0
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...

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.