WCF配置帮助-can';我没弄对

WCF配置帮助-can';我没弄对,wcf,web-config,behavior,endpoint,Wcf,Web Config,Behavior,Endpoint,我已经为此挣扎了几天了。我正在尝试在IIS中托管WCF服务,以便我们的其他网站可以访问此服务将公开的数据。编写代码相当简单,无论我尝试什么,我都无法正确地进行配置 我正在努力实现的目标: 在http(s)://service.motors.coop(我们还没有SSL证书)上提供http和https背后的服务 能够被.net、PHP、iOS、Android等调用(尽管我确信这不是基于配置的) 通过浏览器访问方法来测试这些方法,例如 每当我尝试访问时,都会出现以下错误: 由于EndpointDisp

我已经为此挣扎了几天了。我正在尝试在IIS中托管WCF服务,以便我们的其他网站可以访问此服务将公开的数据。编写代码相当简单,无论我尝试什么,我都无法正确地进行配置

我正在努力实现的目标:

  • 在http(s)://service.motors.coop(我们还没有SSL证书)上提供http和https背后的服务
  • 能够被.net、PHP、iOS、Android等调用(尽管我确信这不是基于配置的)
  • 通过浏览器访问方法来测试这些方法,例如
  • 每当我尝试访问时,都会出现以下错误:

    由于EndpointDispatcher上的AddressFilter不匹配,无法在接收器上处理收件人为“”的消息。检查发送方和接收方的端点地址是否一致

    有这么多的配置选项,我不知道从哪里开始,虽然我读了无数的文章,甚至买了一本书-它太复杂了

    有什么灵魂会帮我处理配置文件吗

    <?xml version="1.0"?>
    <configuration>
      <connectionStrings>
        <!-- removed -->
      </connectionStrings>
      <system.web>
        <compilation debug="true" targetFramework="4.0"/>
        <customErrors mode="Off"/>
        <httpRuntime/>
      </system.web>
      <system.serviceModel>
    <services>
      <service behaviorConfiguration="ServiceBehaviour" name="MotorsWcfService.MotorsService">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="" name="MotorsServiceEndpoint" contract="MotorsWcfService.IMotorsService"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="https://service.motors.coop/MotorsService"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="EndpointBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false"/>
    
    
    

    更新:通过向导创建配置后,我现在有了以下文件:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <system.serviceModel>
        <standardEndpoints>
            <webHttpEndpoint>
                <standardEndpoint name="WebHttpEndPoint" defaultOutgoingResponseFormat="Json" />
            </webHttpEndpoint>
        </standardEndpoints>
        <behaviors>
        <serviceBehaviors>
            <behavior name="MyServiceTypeBehaviors" >
                <serviceMetadata httpGetEnabled="true" />
            </behavior>
        </serviceBehaviors>
        </behaviors>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding" />
            </basicHttpBinding>
            <webHttpBinding>
                <binding name="WebHttpBinding" />
            </webHttpBinding>
        </bindings>
        <services>
            <service name="MotorsWcfService.MotorsService" behaviorConfiguration="MyServiceTypeBehaviors" >
                <endpoint address="http://service.motors.coop" binding="webHttpBinding"
                    bindingConfiguration="WebHttpBinding" contract="MotorsWcfService.IMotorsService" />
                <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
            </service>
        </services>
    </system.serviceModel>
    
    
    

    但是,我仍然会遇到以下错误:

    由于EndpointDispatcher上的AddressFilter不匹配,无法在接收器上处理收件人为“”的消息。检查发送方和接收方的端点地址是否一致

    请检查此链接和


    我认为这可能会帮助您

    尝试用UI加载配置-更容易检测问题。打开VS命令提示符,并写入svcconfigeditor.exe。请签出此链接:。然后您可以加载配置,它将验证配置以供启动。@StephenBorg感谢您的响应。我已尽最大努力完成了向导,但由于EndpointDispatcher上的AddressFilter不匹配,仍然无法在接收方处理“收件人为”的消息。检查发送方和接收方的端点地址是否一致。错误。我已经用我的新配置更新了我的帖子。你知道是什么导致了这个错误吗?