简体   繁体   English

WCF服务-端点未显示

[英]WCF Service - Endpoint is not showing

I have a WCF Service where it has one endpoint and I have the service contract and operation contract setup in the config file but when I run the service, it cannot find the endpoint although I configured it in the web.config. 我有一个WCF服务,其中有一个端点,并且在配置文件中有服务合同和操作合同设置,但是当我运行该服务时,尽管我在web.config中配置了它,但它找不到端点。

This service will be setup in IIS so I have no base address setup. 该服务将在IIS中设置,因此我没有基址设置。

The ServiceContract has a configuration name of agent_port_type and the service behavior has a configuration name of agent_service. ServiceContract的配置名称为agent_port_type,服务行为的配置名称为agent_service。 I am using basicHttpBinding. 我正在使用basicHttpBinding。

Below is a copy of part of my config file: 以下是我的配置文件的一部分的副本:

 <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ETAOutboundServiceBehavior">
          <serviceMetadata httpGetEnabled="true"  httpsGetEnabled="true"  />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="Metadata">
          <serviceMetadata httpGetEnabled="true"  httpsGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="ETAOutboundServiceBehavior" name="agent_service">
        <clear />
        <endpoint address="" name="agent_interface" binding="basicHttpBinding" contract="agent_port_type"
          listenUriMode="Explicit" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
          listenUriMode="Explicit" />
      </service>
    </services>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Any help would be appreciated. 任何帮助,将不胜感激。 I had it working on a different service fine but then I used svcutil to create agent_port_type and it is not working. 我让它可以在其他服务上正常工作,但是后来我使用svcutil创建agent_port_type,但是它无法正常工作。

You should try simplifying the config to something that Works, then add extra options as need. 您应该尝试将配置简化为可行的配置,然后根据需要添加其他选项。

Start With: 从...开始:

  • Remove Clear tag 删除清除标签
  • Remove all References to HTTPS 删除所有对HTTPS的引用
  • Remove listenURIMode 删除listenURIMode

  • Add an address for the endpoint 为端点添加地址

  • Check the IIS log that you are calling the service that you think you are calling 检查您正在调用的服务的IIS日志

  • Add a syntax error to Your config and check that it fails (to make sure that the config file you are editing is the one being used) 将语法错误添加到您的配置中,并检查其是否失败(以确保您正在编辑的配置文件是正在使用的配置文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM