List Info

Thread: Error to define two messages soap with the same root node of response




Error to define two messages soap with the same root node of response
user name
2006-03-26 21:22:30
Hi

Why is not posible to define two messages soap with the same
root node in
the response?

This code:

public class Sample : System.Web.Services.WebService {



    [System.Web.Services.WebMethodAttribute()]


[System.Web.Services.Protocols.SoapDocumentMethodAttribute(R
esponseElementNa
me = "X", ResponseNamespace = "N")]

    public bool initModule()

    {

        return true;

    }





    [System.Web.Services.WebMethodAttribute()]


[System.Web.Services.Protocols.SoapDocumentMethodAttribute(R
esponseElementNa
me="X", ResponseNamespace="N")]

    public bool startActivity()

    {

        return true;

    }





}

Throws InvalidOperationException exception

Thanks In advance

Javier


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Newbie question regarding web service reentrancy problem
user name
2006-03-27 23:49:29
In my web application, I have developed a 'Users Online'
module (implemented
as a user control) using Atlas. This user control calls a
web service (to
let it know that this user is online)  as soon and as long
as the user has
my web application open in his browser. This same user
control has code to
check if a user is online. I can throw this user control in
places such as a
data grid which shows lists of users. As soon as a user
comes online, a
'User online' lighbulb lights up next to that user's name
in the datagrid
row. The problem is that the User Online icon lights up and
goes off
erratically.

At the heart of this operation is my web service which has 2
methods which I
have copied below. The problem I am running into is that I
think I have
reentrancy problems in my web service methods. There is a
large number of
web service calls being made to this web service. How can I
avoid multiple
threads from entering my web service method  simultaneously?


<WebMethod()> _

Public Sub MarkEntityAsOnline(ByVal EntityClass As String,
ByVal EntityId As
String)

Try

Dim ctx As HttpContext = HttpContext.Current

If ctx IsNot Nothing Then

ctx.Cache.Insert(EntityClass & EntityId,
"Y", Nothing,
DateTime.Now.AddMinutes(1), Cache.NoSlidingExpiration)

End If

Catch ex As System.Exception

Finally

End Try

End Sub

<WebMethod()> _

Public Function IsEntityOnline(ByVal EntityClass As String,
ByVal EntityId
As String) As String

Dim retVal As Boolean = False

Try

Dim ctx As HttpContext = HttpContext.Current

If ctx IsNot Nothing Then

Dim cache_item As Object = ctx.Cache.Item(EntityClass &
EntityId)

If cache_item IsNot Nothing Then

retVal = True

End If

End If

Catch ex As System.Exception

Finally

End Try

Return retVal.ToString().ToUpper()

End Function


===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )