WCF service client application receives "Object not installed for object instance"

just deployed my WCF service to a server here in my company using IIS 7.5 and everything works fine. But when I configure my client application and add the server link to the server, and then use this code.

ServerReference.ServiceClient client = new ServerReference.ServiceClient(); var s = client.GetBrand("Audi", false); 

I get an exception that says "the reference to the object is not set to the instance of the object." the s object should not be b null (we tried the service on localhost, where we had everything in the same project where it worked).

You looked at the stack, and it looks like this.

 21.6.2012 16:16:29 

The reference to the object is not installed in the instance of the object.

 Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Any suggestions? PS The CPU hosting the WCF service has no visual studios, so I cannot debug it through

+6
source share
4 answers

As I said in a comment, make sure you can get the data using WcfTestClient . This confirms that the service is running, and it tests the method call almost singly, ensuring that it works from the clientโ€™s point of view.

Secondly (if you didnโ€™t lower it before publishing to SO), use the correct WCF invocation method to avoid such problems. When you add a dependency, it is always a good idea to anticipate failures (although your service, client Internet connection or otherwise).

Without knowing anything about your project, it is difficult to describe how to fix it. Factors, such as the old WSDL, the incorrectly configured * .config, the unexposed endpoint on the server, and other problems, may be the root of the problem, but given what you showed, I have no idea what it could be.

If you can provide more details, I will be happy to update my answer with any advice I may have. For now, take a look at enabling WCF tracing on the server so that you can view the log (s) and see the end of the server (in addition to navigating through your client call and checking).

+2
source

You do not need to debug it. Just add the WCF trace setting to web.config and you can get information about the original error. See http://msdn.microsoft.com/en-us/library/ms733025.aspx

+1
source

I have the same problem in my project, in my case I found that the exception occurred in the service constructor, but it only works when any method is called.

0
source

Configure trace sources to emit traces and set trace levels, configure trace and activity propagation to support end-to-end trace correlation, and set tracers to access traces.

The Windows Communication Foundation (WCF) displays the following data for diagnostic tracing: Tracing process steps in all application components, such as operation calls, code exceptions, warnings, and other important processing events. Windows error events when the trace function is not working properly. See Event Log in WCF .

0
source

Source: https://habr.com/ru/post/918680/


All Articles