I have two projects in a solution. An ASP.NET Web Application and ASMX Web Service Application. ASMX Web Service is referenced in ASP.NET Web Application(As Web References).

In aspx page we create an object of Web Service and call methods on it like following.

```
MyWebService myWebService = new MyWebService();
UserDetail userDetail = myWebService.GetUserDetail(25);

```

This means my aspx page depends upon on concrete implementation of MyWebService. According to Dependency Inversion Principle (DIP), code should depend on abstractions, not concrete implementations and that those abstractions should not depend on details; the details should depend on the abstractions.

How do i remove this dependency? 

On Google i came across following articles which is similar but not exactly to what i am looking for.

* <http://www.springframework.net/doc-latest/reference/html/webservices.html>
* <http://www.codeproject.com/Articles/310677/ASP-NET-Web-Services-Dependency-Injection-using-Un>
* <http://www.gitshah.com/2011/11/integrating-springnet-with-asmx.html>

All these articles explains about injecting dependency into asmx web service and not injecting asmx web service dependency into asp.net web application.

I am newbie to term Dependency Injection and i may be thinking the wrong way and going in a wrong direction.

Plesae help me understand this confusion.