Link to home
Start Free TrialLog in
Avatar of programmerist 1983
programmerist 1983Flag for Türkiye

asked on

How to host Wcf service in IIS problem?

<p>i have read more articles but i can nto host wcf service in IIS</p>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="WcfSrv.MyProject.GetTables.ServiceCrm">
        <endpoint address="" binding="wsHttpBinding" contract="WcfSrv.MyTechnic.GetTables.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfSrv.MyProject.GetTables/ServiceTest/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True" />
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

Open in new window

MyCodes:These code wcf service codes

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data.Objects;

namespace WcfSrv.MyProject.GetTables
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ServiceTest : IService
    {
        public List GetAllData(string CustomerName)
        {
            using (CrmEntities crmCtx = new CrmEntities())
            {
                return crmCtx.GetAllDataCustomer(CustomerName).ToList();
            }

        }


    }
}

Open in new window

Avatar of programmerist 1983
programmerist 1983
Flag of Türkiye image

ASKER

ARE YOU THERE?
ITT IS TOOOOOOOOOOOOOOO URGENT !!!!!!!!!!!!!!!!!!!!!!!!
ASKER CERTIFIED SOLUTION
Avatar of databoks
databoks
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial