I am completely new to WCF
and deploying of services. I am having trouble setting up my service on IIS 6.0.
I need the exact steps to deploy my WCF
service on IIS 6.0.
Note: I created a WCF
service application...
So, what is the exact steps i need to follow to deploy my wcf service on IIS 6.0?
You have basically two options, I believe:
Option 1 - "bin" deploy (preferred option)
.\bin
folder*.svc
file in that websiteweb.config
in the website folder to define your endpoints and service configuration etc.Your WCF service will now be reachable at the website's base address, plus the name of the *.svc
file, e.g.
http://myserver/someweb/Myservice.svc
Your *.svc
would look something like this:
<%@ ServiceHost Language="C#" Debug="true"
Service="WCF_Simple_Service.HelloIndigoService" %>
The Service=
attributes denotes the class implementing the service - fully qualified with its namespace.
Option 2 - put stuff into App_Code
*.cs
files directly into the .\App_Code
folder*.svc
file in that websiteweb.config
in the website folder to define your endpoints and service configuration etc.Your WCF service will now be reachable at the website's base address, plus the name of the *.svc
file, e.g.
http://myserver/someweb/Myservice.svc
Your *.svc
would look something like this:
<%@ ServiceHost Language="C#" Debug="true"
Service="Service"
CodeBehind="~/App_Code/Service.cs" %>
A simple, sample web.config
might look something like this:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="WithDebug">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="SimpleWCF.HelloIndigoService" behaviorConfiguration="true">
<endpoint
address=""
binding="basicHttpBinding"
contract="SimpleWCF.IHelloIndigoService" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
You basically define your <service>
tag - and again: the name=
denotes the class implementing the service - fully qualified with its namespace. It must contain at least one endpoint - since IIS6 only support HTTP, you can use basicHttpBinding
or wsHttpBinding
and that's about all there is. A "mex" endpoint is optional - but very useful, especially for development and testing. It allows client to "discover" the service and get its service description so it can interface with it.
Once your service is deployed in IIS, you can see it in action using a tool like the WCF Test Client that ships for free with WCF, or SoapUI which is a general-purpose SOAP testing utility (with a free edition for you to use).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With