WCF client gets "Object reference not set to an instance of anobject"

J

jake

My WCF client gets this error on the following line:

Line 62: public string[] MyMethod(string keywords, int
numberOfRecords)
Line 63: {
Line 64: return base.Channel.MyMethod(keywords, numberOfRecords);
<---------this is the line
Line 65: }
Line 66:

this is part of:

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel",
"3.0.0.0")]
public partial class MyServiceClient :
System.ServiceModel.ClientBase<IMyService>, IMyService
{...}

in MyService.cs proxy generated by svcutil.

MyService is "running" on the same machine as a web service. This is
confirmed.
Otherwise svcutil would not have been able to generate the client
proxy.

My web.config is properly configured (generated) by svcutil;
I am properly instantiating the service client

MyServiceClient xxx = new MyServiceClient(); // there is only one
endpoint

xxx.State returns "Created", so I know the instantiation worked.

All my interfaces and other code seem proper.

It just seems to me that "base.Channel" is not being recognized as an
object? Or am I way off on this?

By the way, this code worked until I added 2 other methods.

I have since deleted them and brought back the project to where it was
when it was working but to no avail.

Any help is appreciated.
 
J

jake

Nevermind! I am too stupid to live. Channel is ok. Client app is
ok. A class was not being instantiated in the service itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top