Home All Groups Group Topic Archive Search About

"Object reference not set" when calling web service

Author
28 Feb 2006 2:14 PM
DaveO.
Hello,

I'm calling a VB.NET web service, also from VB.NET, and I get the error
" Object reference not set to an instance of an object" on the
following line in Reference.vb, when it tries to make the call:

Dim results() As Object = Me.Invoke("Phys_Post", New Object()
{SessionID, a, b, c, d, CountList})

I can call other web services I've written just fine. This one is more
complex in that it has an arraylist of structures as a parameter. In
the past I've found that I need to instantiate this as an empty array

        Dim counts As localhost.Physicalcountlist()
        counts = New localhost.Physicalcountlist() {}

and not just declare its type. But I still get the error. The other
parameters are just integers and strings, no arrays. I understand what
the error is saying, but I can't figure out exactly what it's referring
to, or why it's happening.

Any suggestions?

Thanks,
DaveO.

Author
3 Mar 2006 9:55 AM
Armin Zingler
Show quote Hide quote
"DaveO." <daveoverb***@yahoo.com> schrieb
> Hello,
>
> I'm calling a VB.NET web service, also from VB.NET, and I get the
> error " Object reference not set to an instance of an object" on the
> following line in Reference.vb, when it tries to make the call:
>
> Dim results() As Object = Me.Invoke("Phys_Post", New Object()
> {SessionID, a, b, c, d, CountList})
>
> I can call other web services I've written just fine. This one is
> more complex in that it has an arraylist of structures as a
> parameter. In the past I've found that I need to instantiate this as
> an empty array
>
>        Dim counts As localhost.Physicalcountlist()
>        counts = New localhost.Physicalcountlist() {}
>
> and not just declare its type. But I still get the error. The other
> parameters are just integers and strings, no arrays. I understand
> what the error is saying, but I can't figure out exactly what it's
> referring to, or why it's happening.
>
> Any suggestions?


Maybe you don't get an answer because other people also, like me, didn't
find an Invoke method taking a string as the first parameter. It's also not
clear what "Me" is. A WindowsForm? In that case, the first arg must be a
delegate.
This is only a hint. I probably won't be able to help you if it's a web
service problem.


Armin