Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <system.serviceModel>
- <services>
- <!-- This section is optional with the default configuration introduced
- in .NET Framework 4. -->
- <service name="WCF_Example.Service1" behaviorConfiguration="mexBehavior">
- <endpoint address="WCF_ServiceExample" binding="basicHttpBinding" contract="WCF_Example.IService1" />
- <endpoint address="WCF_ServiceExample" binding="netTcpBinding" contract="WCF_Example.IService1" />
- <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
- <host>
- <baseAddresses>
- <add baseAddress="http://localhost:61940/"/>
- <add baseAddress="net.tcp://localhost:61940/"/>
- </baseAddresses>
- </host>
- </service>
- </services>
- <bindings>
- <basicHttpBinding>
- <binding name="transportSecurity">
- <security mode="TransportWithMessageCredential">
- <message clientCredentialType="UserName" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- <!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
- <behaviors>
- <serviceBehaviors>
- <behavior name="mexBehavior">
- <serviceMetadata httpGetEnabled="True"/>
- <serviceDebug includeExceptionDetailInFaults="False" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- public ActionResult Index()
- {
- using (ServiceHost host = new ServiceHost(typeof(WCF_Example.Service1)))
- {
- host.Open();
- }
- return View();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement