Wcf Service Basic Part Four

In this lesson we will learn about app.config file which is auto generated by for us by visual studio .

Here is the app.config file code ..

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="ClassLibrary1.StudentWcfService">
                <endpoint address="" binding="basicHttpBinding" contract="ClassLibrary1.IStudentWcfService">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8733/Design_Time_Addresses/ClassLibrary1/StudentWcfService/" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>


In first line it is definition of the version and type of version as well then we have configuration  section , inside this section service model assembly is defined then we have behaviors section . In this section we defined the name of the behavior then service metadata behavior  for HTTP ,HTTPs  protocol and service debug exception details will be included or not . Then services is defined . Inside this section we defined name of the service ,end point and host of the service. 

No comments:

Post a Comment