"Peter K" <> wrote in message
news:...
>
> "Mark Rae [MVP]" <> skrev i en meddelelse
> news:%...
>> "ThatsIT.net.au" <me@work> wrote in message
>> news:EF3B587C-44B2-4011-BAE7-...
>>
>>>> "ThatsIT.net.au" <me@work> skrev i en meddelelse
>>>> news:5BBFB070-9610-4824-8F88-...
>>>>>I have a object that I want to pass back though a web service to the
>>>>>consumer. when I do this i get the object but can not see any methods.
>>>>>the object is decleared in the webservice as PublicUser, in the
>>>>>consuming web site PublicUser comes up in intellisence so i know that
>>>>>it must be comming though ok, but I can not access its methods.
>>>>>
>>>>> Am i missing something any ideas?
>>>>
>>>> Hard to say what your problem could be. Are the properties in your
>>>> custom class public?
>>>
>>> yes they are
>>
>>
>> Are you casting the deserialised object back to a PublicUser...?
>
> The times I've written consumers of webservices, this has not been
> necessary. I use Visual Studio to create the appropriate proxy, and the
> generated class can simply be used by my consumer.
>
> For example, in Visual Studio, I create a "web reference" to the
> webservice at http://somewebservice.asmx,
>
> Then in code I can do something like:
>
> SomeWebServiceRef.WebServiceName ws = new
> SomeWebServiceRef.WebServiceName();
> SomeWebServiceRef.MyCustomClass result = ws.GetTheResult(123);
>
>
> /Peter
>
>
that looks the same
Dim w As WebUser = New WebUser
Dim oUser As PublicUser = CType(w.getUser, PublicUser)
Response.Write(oUser.www)
www is a method, but it gives an error saying www is not a method of oUser,
by the way I can access www in the web service, so object is correct at that
point.
webService below
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http ://thatsbooking.com.au/WebUser")>
_
<System.Web.Services.WebServiceBinding(ConformsTo: =WsiProfiles.BasicProfile1_1)>
_
<Serializable()> _
<ToolboxItem(False)> _
Public Class WebUser
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod()> _
Public Function getUser() As TBBO.PublicUser
Dim u As TBBO.PublicUser = New TBBO.PublicUser
Return u
End Function
Public Sub New()
End Sub
End Class