> > Hi all, hope someone can help here, I'm really stuck. Reading and
> > googling like mad, to no avail so far...
[quoted text clipped - 81 lines]
> Regards,
> Sami
> > > Hi all, hope someone can help here, I'm really stuck. Reading and
> > > googling like mad, to no avail so far...
[quoted text clipped - 95 lines]
>
> AW
Forget that - I've solved that part of the problem by referencing a
common type defined in a common namespace. Found the dox on how to do
this at MSDN (eventually).
However, I seem to have a problem returning a value from my webservice
now: I created a 'local' copy of the webservice and it ran fine. When I
run it remote, it returns an empty list.
Any thoughts?
Here's a snippet:
<WebMethod()> Function getsomestuff() As Envelope
Return New Envelope(1, 2, 3, 4)
End Function
And in my generated Reference.vb:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://server:13100/imsService/imsServices/getsomestuff",
RequestNamespace:="http://server:13100/imsService/imsServices",
ResponseNamespace:="http://server:13100/imsService/imsServices",
Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
Public Function getsomestuff() As Envelope
'Return New Envelope(1100, 2200, 3300, 4400)
Dim results() As Object = Me.Invoke("getsomestuff", New
Object(-1) {})
Return CType(results(0), Envelope)
End Function
'<remarks/>
Public Function Begingetsomestuff(ByVal callback As
System.AsyncCallback, ByVal asyncState As Object) As
System.IAsyncResult
Return Me.BeginInvoke("getsomestuff", New Object(-1) {},
callback, asyncState)
End Function
'<remarks/>
Public Function Endgetsomestuff(ByVal asyncResult As
System.IAsyncResult) As Envelope
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0), Envelope)
End Function
When that returns, I don't get my 1,2,3,4 as expected - I get 0,0,0,0
which is the default for a new envelope. If I uncomment the hard-coded
return above (1100, 2200 etc) then that works fine and I get those
numbers back as expected.
Any ideas why?
Thanks in advance - the finish line is in sight, but it's a struggle
all the way at the moment..
Thanks
AW
Sami Vaaraniemi - 12 Jul 2005 08:33 GMT
Comments inline:
[snip]
> Forget that - I've solved that part of the problem by referencing a
> common type defined in a common namespace. Found the dox on how to do
> this at MSDN (eventually).
Yes, this is what you can do, with a couple of caveats (see below).
> However, I seem to have a problem returning a value from my webservice
> now: I created a 'local' copy of the webservice and it ran fine. When I
> run it remote, it returns an empty list.
>
> Any thoughts?
Could it be that the data that is missing is private? Make sure that the
fields (properties or methods) are public in the class. Otherwise they won't
be included in XML serialization. This is what I meant earlier by saying
that 'private state is lost'.
> When that returns, I don't get my 1,2,3,4 as expected - I get 0,0,0,0
> which is the default for a new envelope. If I uncomment the hard-coded
[quoted text clipped - 5 lines]
> Thanks in advance - the finish line is in sight, but it's a struggle
> all the way at the moment..
It is admittably a bit of a hassle if you want to share types this way.
Regards,
Sami