Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing WCF REST services with Unity on IIS
    primarykey
    data
    text
    <p>I am trying to use dependency injection with WCF REST (WebGet) and am having trouble understanding where I would use Unity to build my object to host the web service.</p> <p>I have seen many examples all over the web, but they seem to all be hosting the service in a console app or Windows service.</p> <p>Currently my config file looks like this:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="Services.MyRestService"&gt; &lt;endpoint address="http://localhost:8732/api" binding="webHttpBinding" contract="Shared.Services.IMyRestService"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;startup&gt; &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt; &lt;/startup&gt; &lt;/configuration&gt; </code></pre> <p>Currently the way it works is using the built in WCF service host in Visual Studio. However, I'd like to run this in IIS and use Unity to configure my container. Now I am using "<a href="https://stackoverflow.com/questions/7099406/what-is-the-real-difference-between-bastard-injection-and-poor-mans-injectio">bastard injection</a>" to get the job done, but would like to use Unity to supply the data provider implementation, etc.</p> <p>My question is, what configuration changes do I need to make to host this in IIS and also where do I configure the container and let IIS know about it.</p> <p>There are no SVC files as this is a WCF Service Library.</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload