Как разместить службу Wcf в проблеме IIS? - PullRequest
0 голосов
/ 14 июня 2011

я прочитал больше статей, но не могу разместить службу wcf в IIS


<?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>

MyCodes: эти коды службы wcf


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();
            }

        }


    }
}

я пытаюсь разместить службу Wcf 192.168.0.218 я добавил файл Srv и новый виртуальный каталог dll, но я не могу использовать сервис wcf. Как это сделать?я изменил конфигурационный файл С наилучшими пожеланиями ...

Ответы [ 2 ]

1 голос
/ 14 июня 2011

Установили ли вы (пере) базовую интеграцию asp в IIS, используя aspnet_regiis -i (C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i)

Поскольку вы не указываете точную ошибку, трудно помочь, но файлы SVC должныбыть связанным в IIS, который при повторном выполнении приведенного выше утверждения обычно решает эту проблему.

1 голос
/ 14 июня 2011

Службы WCF, размещенные в IIS, представлены в виде файлов специального содержимого (файлы .svc) внутри приложения IIS.См. Раздел «Размещение служб WCF в IIS» здесь , как его использовать и как разместить службу WCF.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...