Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jake - 20 Mar 2008 19:19 GMT
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.
jake - 20 Mar 2008 21:34 GMT
Nevermind!  I am too stupid to live.  Channel is ok.  Client app is
ok.  A class was not being instantiated in the service itself.

> My WCF client gets this error on the following line:
>
[quoted text clipped - 41 lines]
>
> Any help is appreciated.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.