Yanshof
Yanshof

Reputation: 9926

How to configure the IIS to support WCF service?

I wrote WCF service ( web service ). I never work with the IIS - and i dont know if i need to change \ config something in the IIS to work with my service.

Someone can help me ?

Thanks

P.S: IIS version is 7.5

Upvotes: 0

Views: 4301

Answers (1)

Nima M
Nima M

Reputation: 718

Hosting a service on an IIS Web server is very similar to hosting a traditional Web service (with an .asmx file extension).

Services hosted in IIS require the creation of a file with an .svc file extension. This is done for you automatically if you use the Visual Studio 2008/2010 WCF Service template. The Service.svc file is an XML-based file that must include an @ServiceHost directive.

<% @ServiceHost Language="C#" Service="EmployeeService" %>

in the web config you can leave the address attribute blank.

        <services>
            <service name="EmployeeService">
                <clear />
                <endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IEmployeeService" />
                <endpoint binding="wsHttpBinding" name="wsHttpBinding" contract="IEmployeeService" />
                <endpoint binding="basicHttpBinding" name="basicHttpBinding" contract="IEmployeeService" />
            </service>
        </services>

For more info take a look at: http://msdn.microsoft.com/en-us/library/ms733766.aspx

Upvotes: 1

Related Questions