Bug 6201 - NullReferenceException using ChannelFactory created with ServiceEndpoint constructor (regression)
Summary: NullReferenceException using ChannelFactory created with ServiceEndpoint cons...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-07-19 13:20 UTC by richard
Modified: 2012-09-15 15:17 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
TestCase (58.99 KB, application/octet-stream)
2012-07-19 13:20 UTC, richard
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description richard 2012-07-19 13:20:20 UTC
Created attachment 2232 [details]
TestCase

Creating a ChannelFactory<T> using the ChannelFactory<TChannel>(ServiceEndpoint) constructor results in a channel that throws a NullReferenceException when used.

Tested in Mono 2.10.8.1 on Linux. This is a regression (works in Mono 2.10.6 and earlier). 

Complete test case attached:

- Running server on Windows (didn't test on Linux, suspect same bug exists server side)
- Running client on Linux

Output when using Mono 2.10.6:
Testing regular constructor...
True
Testing service endpoint constructor...
True
Done...

Output when using Mono 2.10.8.1.:
Testing regular constructor...
True
Testing service endpoint constructor...
System.NullReferenceException: Object reference not set to an instance of an object
  at System.ServiceModel.Channels.HttpRequestChannel.BeginProcessRequest (System.ServiceModel.Channels.HttpChannelRequestAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.HttpRequestChannel.BeginRequest (System.ServiceModel.Channels.Message message, TimeSpan timeout, System.AsyncCallback callback, System.Object state) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 
Done...
Comment 1 Alexander Ivanov 2012-09-15 11:03:05 UTC
Got same bug. Workaround - you can use NetTcpBinding, there is no error.
Comment 2 Martin Baulig 2012-09-15 15:17:41 UTC
Trivial fix :-)

mono/master commit d2d43552, mono/mono-2-10 commit 9c5a1b6.