cwienands
12-21-2006, 11:44 PM
Hey guys,
I'm pretty much lost right now. I'm trying to do dependency injection for web services but whatever I do is getting a "Object reference not set to an instance of an object" exception when I navigate to that web service in the web browser. I'm not even at the point where the dependency gets injected but rather it's somewhere in the WebServiceHandlerFactory. Here is what I have:
Stack trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Spring.Web.Services.WebServiceHandlerFactory.Syste m.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +87
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
System.Web.MapHandlerExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +139
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +146
In web.config:
<httpHandlers>
<add verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
</httpHandlers>
In SpringConfiguration.xml:
<object name="TestService" type="AISWebService.Test, AISWebService" abstract="false"/>
<object id="Test.asmx" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="TestService"/>
<property name="Namespace" value="http://SpringWS/WebServices"/>
</object>
Test.cs
namespace AISWebService
{
public class Test : ITest
{
[WebMethod]
public void HelloWorld()
{
}
}
public interface ITest
{
void HelloWorld();
}
}
Global.asax
IApplicationContext context = new XmlApplicationContext("assembly://AISWebService/AISWebService/SpringConfiguration.xml");
I'm using Spring 1.0.2. I did some tests and the application context gets properly initialized. Beside that I have no idea why the WebServiceHandlerFactory somehow craps out.
Does anybody here have a clue what I'm doing wrong? By the way, I got the same problem when working without the WebServiceExporter.
Thanks a million, Christoph
I'm pretty much lost right now. I'm trying to do dependency injection for web services but whatever I do is getting a "Object reference not set to an instance of an object" exception when I navigate to that web service in the web browser. I'm not even at the point where the dependency gets injected but rather it's somewhere in the WebServiceHandlerFactory. Here is what I have:
Stack trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Spring.Web.Services.WebServiceHandlerFactory.Syste m.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +87
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
System.Web.MapHandlerExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +139
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +146
In web.config:
<httpHandlers>
<add verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
</httpHandlers>
In SpringConfiguration.xml:
<object name="TestService" type="AISWebService.Test, AISWebService" abstract="false"/>
<object id="Test.asmx" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="TestService"/>
<property name="Namespace" value="http://SpringWS/WebServices"/>
</object>
Test.cs
namespace AISWebService
{
public class Test : ITest
{
[WebMethod]
public void HelloWorld()
{
}
}
public interface ITest
{
void HelloWorld();
}
}
Global.asax
IApplicationContext context = new XmlApplicationContext("assembly://AISWebService/AISWebService/SpringConfiguration.xml");
I'm using Spring 1.0.2. I did some tests and the application context gets properly initialized. Beside that I have no idea why the WebServiceHandlerFactory somehow craps out.
Does anybody here have a clue what I'm doing wrong? By the way, I got the same problem when working without the WebServiceExporter.
Thanks a million, Christoph