尝试引用WCF服务时,没有端点在监听.... [英] There was no endpoint listening at ... when trying to reference an WCF service?

查看:93
本文介绍了尝试引用WCF服务时,没有端点在监听....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助我,我试图将服务引用添加到WCF服务托管在服务器上.

这是我用来尝试添加服务的网址参考

(当我在Internet Explorer中键入此url时,xml就会通过)

> 这是配置文件

This is the configuration file

>   < system.serviceModel >

  <system.serviceModel>

>     < 服务 >

    <services>

>    

      

>      < 服务 名称 = " 行为配置 = " Mex_MyService " >

      <service name="MyService.MyService " behaviorConfiguration="Mex_MyService">

>          < 端点 地址 = "

          <endpoint address="net.tcp://localhost/MyService"

>                绑定 = "

                    binding="netTcpBinding"

>                bindingConfiguration = "

                    bindingConfiguration="tcpBinding"

>                合同 = "

                    contract="MyService.IMyService"

>        />

        />

>        </ 服务 >

        </service>

>     </ 服务 >

    </services>

 

>     < 绑定 >

    <bindings>

>      < netTcpBinding >

      <netTcpBinding>

>        < 绑定 名称 = " sendTimeout = " 00:02: 00 " receiveTimeout = " 00:02: 00 " transactionFlow = " true " portSharingEnabled = " true "

        <binding name="tcpBinding" sendTimeout="00:02:00" receiveTimeout="00:02:00" transactionFlow="true" portSharingEnabled="true"

> maxBufferPoolSize = " maxBufferSize = " 67108864 " maxReceivedMessageSize = " 67108864 " >

                 maxBufferPoolSize="67108864" maxBufferSize="67108864" maxReceivedMessageSize="67108864">

>          < readerQuotas maxArrayLength = " maxStringContentLength = " 67108864 " maxDepth = " 67108864 " />

          <readerQuotas maxArrayLength="67108864" maxStringContentLength="67108864" maxDepth ="67108864" />

>        </ 绑定 >

        </binding>

>      </ netTcpBinding >

      </netTcpBinding>

>     </ 绑定 >

    </bindings>

 

>     < 行为 >

    <behaviors>

>      < serviceBehaviors >

      <serviceBehaviors>

>        < 行为 名称 = " >

        <behavior name="Mex_MyService">

>          < serviceMetadata httpGetEnabled = " httpGetUrl = " http://本地主机:9001/MyService "> />

          <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:9001/MyService"/>

>          < dataContractSerializer maxItemsInObjectGraph = " />

          <dataContractSerializer maxItemsInObjectGraph="67108864"/>

>        </ 行为 >

        </behavior>

>      </ serviceBehaviors >

      </serviceBehaviors>     

>     </ 行为 >

    </behaviors>

system.serviceModel >

  </system.serviceModel>

> 这是尝试引用此服务时的错误消息

This is the error message when trying to reference this service

该文档已被理解,但无法处理.

  - The WSDL document contains links that could not be resolved.

  - There was an error downloading 'http://localhost:9001/MyService?xsd=xsd0'.

  - Unable to connect to the remote server

  - No connection could be made because the target machine actively refused it 127.0.0.1:9001

元数据包含无法解析的引用:'http://MyServer:9001/MyService’.

没有端点在听 http://MyServer:9001/MyService 可以接受该消息.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException(如果存在).

There was no endpoint listening at http://MyServer:9001/MyService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

远程服务器返回错误:(404)未找到.

如果服务在当前解决方案中定义,请尝试构建解决方案并再次添加服务引用.

推荐答案

您好,

快速回复一下.

-您应该在net.tcp地址上设置端口号:net.tcp://localhost:9001/MyService.

- You should set the port number on the net.tcp address: net.tcp://localhost:9001/MyService.

-您不应在混合地址上设置端口号:http://localhost/MyService

- You should not set the port number on the mex address: http://localhost/MyService

我不确定这是否是解决方案,但这至少是合乎逻辑的事情:)

I'm not sure if this is the solution, but it's at least a logical thing to do:)


这篇关于尝试引用WCF服务时,没有端点在监听....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆