Hi,
"Beto" <al**********@NOSPAM-PLEASE-yahoo.eswrote in message
news:uC*************@TK2MSFTNGP06.phx.gbl...
>
I have tested that using locks for sinchronize calls to a web service does
not work correctly. Surely I am doing something wrong.
You mean in the client or in the web service itself?
I have a "global" object for the "semaphore":
public object oLockOfWebService = new object();
that instance is a member of what class?
How all the threads in your program get access to it? (I find it weird you
do not declare it as static).
And we have two concurrent libraries (one in c# and another in vb.net)
that realize calls to a webservice with this code:
If you have two processes each one will have their own copy of the
semaphore.
Not only that, but why you need two libraries? you can have only one and use
it from either VB.net or C#
Project A:
SyncLock Me.oGeneric.oLockOfWebService
data = WSClass.GetEventInfo(GuidAgent)
End SyncLock
And the c# code of the project B:
lock (this.oGenericData.oLockOfWebService)
{
oDataTerminalInfo = this.IrmWS.GetTerminalInfo(this.AgentGuid);
}
I have tested (using strings logs) that sometimes one webmethod of the
webservice is called when the other HASN´T finished).
Any idea?
Of course, they are two different projects both will have a copy of the
library and each will have a copy of your semaphore.