Web浏览器无法访问简单的WCF

时间:2015-02-12 17:00:57

标签: c# .net wcf

我正在尝试从我的网络浏览器访问一个简单的WCF服务,但除了空白页面之外什么都没有显示(我使用的是框架.net 4.0),

我试图访问的网址: http://localhost:50269/ConnectorService/web/SynchronizeRessources

服务合同:

namespace WcfDMEConnector
{
    [ServiceContract]
    public interface IConnectorService
    {
        [OperationContract]
        void SynchronizeRessources();
    }
}

这是web.config serviceModel部分:

<system.serviceModel>
    <services>
      <service behaviorConfiguration="Default" name="WcfDMEConnector.ConnectorService">
        <endpoint address="http://localhost:50269/ConnectorService/web" behaviorConfiguration="restfulBehavior" binding="webHttpBinding" contract="WcfDMEConnector.IConnectorService" />
        <endpoint address="http://localhost:50269/ConnectorService/mex" binding="mexHttpBinding" contract="IMetadataExchange" />        
      </service>

    </services>

    <behaviors>
      <endpointBehaviors>
        <behavior name="restfulBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="Default">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

感谢您的帮助

0 个答案:

没有答案