.NET 2.0: Setting WebServiceBindingAttribute.Location leads to a NullReferenceException

Hello,

I currently try the contract-first approach when making Web Services on the .NET 2.0. Trying to set the WebServiceBindingAttribute.Location to point on my hand-made wsdl file leads to a NullReferenceException.

Does anybody have an idea about what's wrong here

Here is the stacktrace:


Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Services.Description.HttpPostProtocolReflector.BeginClass() +42
   System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding) +2127
   System.Web.Services.Description.ProtocolReflector.Reflect() +1111
   System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors) +560
   System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url) +117
   System.Web.Services.Protocols.DocumentationServerType..ctor(Type type, String uri) +159
   System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +335
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +99

[InvalidOperationException: Unable to handle request.]
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +258
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +93

[InvalidOperationException: Failed to handle request.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +240
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +106
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146


 



Thanks,

Alain



Answer this question

.NET 2.0: Setting WebServiceBindingAttribute.Location leads to a NullReferenceException