无法在asp.net中获取元数据Web服务

时间:2018-08-08 14:14:31

标签: asp.net web-services wcf metadata

我正在尝试运行服务,但收到以下错误消息:

错误:无法从http://localhost:8462/ApplicationService.svc获取元数据 如果这是您有权访问的Windows(R)Communication Foundation服务,请检查是否已在指定地址启用了元数据发布。  有关启用元数据发布的帮助,请参阅http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange错误
上的MSDN文档。  URI:http://localhost:8462/ApplicationService.svc元数据包含无法解析的引用:'http://localhost:8462/ApplicationService.svc'。
 没有http://localhost:8462/ApplicationService/ApplicationService.svc处的端点可以接受该消息。  这通常是由不正确的地址或SOAP操作引起的。有关更多详细信息,请参见InnerException。
 无法连接到远程服务器无法建立连接,因为目标计算机主动拒绝了它145.0.0.1:8462HTTP GET错误URI:http://localhost:8462/ApplicationService.svc
 下载“ http://localhost:8462/ApplicationService.svc”时出错。
无法连接到远程服务器无法连接,因为目标计算机主动拒绝了145.0.0.1:8462

这是服务的web.config:

<services>
  <service name="ApplicationService.Services.ApplicationService" behaviorConfiguration="ApplicationService.ApplicationServiceBehavior">
    <endpoint address="IDCS" binding="webHttpBinding" contract="ApplicationService.Interfaces.IDCS" behaviorConfiguration="JSONEndpointBehavior" bindingConfiguration="webHttpBindingConfig_IDCS_Rest"/>
    <endpoint address="soap" binding="basicHttpBinding" contract="ApplicationService.Interfaces.IDCS" behaviorConfiguration="SoapEndpointBehavior" bindingConfiguration="webHttpBindingConfig_IDCS_Soap"/>

  </service>
</services>


<extensions>
  <behaviorExtensions >
    <add name ="jsonWebHttp" type="ApplicationService.Services.JsonErrorWebHttpBehaviorElement, ApplicationService, Version=0.2.4.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>
<behaviors>
  <serviceBehaviors>
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="True" />
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="JSONEndpointBehavior">
      <webHttp/>
      <jsonWebHttp/>
    </behavior>
    <behavior name="SoapEndpointBehavior" >

    </behavior>
  </endpointBehaviors>
</behaviors>


<bindings>
  <webHttpBinding>
    <binding name="webHttpBindingConfig_IDCS_Rest" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000" closeTimeout="00:20:00"
      openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00">
      <readerQuotas maxDepth="200000000" maxArrayLength="200000000" maxStringContentLength="200000000" maxBytesPerRead="200000000" maxNameTableCharCount="200000000"/>
    </binding>
  </webHttpBinding>
  <basicHttpBinding>
    <binding name="webHttpBindingConfig_IDCS_Soap" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000" closeTimeout="00:20:00"
      openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00">
      <readerQuotas maxDepth="200000000" maxArrayLength="200000000" maxStringContentLength="200000000" maxBytesPerRead="200000000" maxNameTableCharCount="200000000"/>
    </binding>
   </basicHttpBinding>    
</bindings>

我检查了类似的问题,并尝试在web.config中添加和更改属性,但是并不能解决问题。

0 个答案:

没有答案