wcf服务端跟客户端在同一台机器上运行,可以正常使用,只要分开就行说,说什么超时之类的问题?

时间:2022-12-22 05:58:07
wcf服务端跟客户端在同一台机器上运行,可以正常使用,只要分开就行说,说什么超时之类的问题?

21 个解决方案

#1


详细信息:
   
 打开操作没有在分配的超时 00:01:00 内完成。分配给该操作的时间可能是更长超时的一部分。

#2


能连上生服务吗?

#3


谢谢二楼,
    能连上。

#4


标记看结果

#5


四楼,您的意思是?我没有明白

#6


wcf服务端跟客户端在同一台机器上运行,可以正常使用,只要分开就行说,说什么超时之类的问题?

继续求解。。。。

#7


服务是什么Host,客户端是什么?

#8


配置文件加上


    <bindings>
      <netTcpBinding>
        <binding name="netTcpBindingSmiple" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:00:05" openTimeout="00:00:02" receiveTimeout="05:05:05" sendTimeout="00:03:30">          
       

        </binding>
      </netTcpBinding>
    </bindings>

设置时间。

#9


服务是host 

 客户端引用的是wsdaulhttpbindig

谢谢8楼跟9楼

8楼的方式我加着呢,不行

#10


谢谢几位的回答。

  我比较想不明白的是,当 wcf服务  与  客户放在同一台机器上可以正常运行呀,
为什么我把服务端放到服务器上就不行呀?

#11


你的是IIS Host呗。(host也有好几种)

(1)检查下服务器防火墙是不是开着?客户端通过浏览器能否取得WSDL?
(2)客户端app.config里的服务端的IP地址修改了吗?

#12


另外 wsdaulhttpbindig 要配两个地址。

#13


引用 12 楼 fangxinggood 的回复:
另外 wsdaulhttpbindig 要配两个地址。



谢谢您的回答,

#14



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="ClassLibrary1.Services" behaviorConfiguration="serviceBehaviors">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://192.168.1.100:8900"/>
            <add baseAddress="http://192.168.1.100:9900"/>
          </baseAddresses>
        </host>
        <endpoint address="Services" contract="ClassLibrary1.IServices" binding="wsDualHttpBinding" bindingConfiguration="wsDualService"/>
        <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehaviors">
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceMetadata httpGetEnabled="true"/>
          
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsDualHttpBinding>
        <binding name="wsDualService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" maxReceivedMessageSize="50000" sendTimeout="00:01:00" maxBufferPoolSize="50000">
          <security mode="None"></security>
        </binding>
      </wsDualHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>




///下面是服务代码
 using (ServiceHost host = new ServiceHost(typeof(Services)))
            {
                host.Open();
                host.Opened += delegate {Console.WriteLine("aucceed"); };
                Console.WriteLine("aucceed");
                Console.ReadKey();
            }


客户端口是用自动引用服务的,不用手动修改IP之类的设置吧,

#15


哦,你用的是Console Host,主要检查下服务端的防火墙是否关闭掉了吧。
服务端是 192.168.1.100 吧?

http://blog.csdn.net/fangxinggood/article/details/6142861

#16


恩,其实我原来是用的winform ,不行,我现在又在用控制台来试呢,

是100

#17


引用 15 楼 fangxinggood 的回复:
哦,你用的是Console Host,主要检查下服务端的防火墙是否关闭掉了吧。
服务端是 192.168.1.100 吧?

http://blog.csdn.net/fangxinggood/article/details/6142861


谢谢您,
  请问您还有别的办法吗?我都服了我的这个wcf了呀,哎..

#18


直接用 netTcpBinding 呀,也支持双工。

刚才上面说的几个检查项目都没问题?客户端在浏览器里敲wsdl能访问?

#19


引用 18 楼 fangxinggood 的回复:
直接用 netTcpBinding 呀,也支持双工。

刚才上面说的几个检查项目都没问题?客户端在浏览器里敲wsdl能访问?

谢谢您的回答。

检查了,没有问题(因为在同一台机器是可以正常访问的(服务与客户端)。

浏览器里敲  http://192.168.1.100:9900/?wsdl  也可以显示出来。

#20


那就是瞎子摸象了。。。

看看这篇文章是否有帮助:

http://www.cnblogs.com/artech/archive/2007/03/29/692032.html

#21


引用 20 楼 fangxinggood 的回复:
那就是瞎子摸象了。。。

看看这篇文章是否有帮助:

http://www.cnblogs.com/artech/archive/2007/03/29/692032.html


谢谢您的回答,
  我的wcf目前还没有用到双向通信的呢,只是我现这样设计的,我换成basichttpbinding就可以了,不过我还是要用双向通信的,我自己再写一个小的demo。
再次谢谢您。

#1


详细信息:
   
 打开操作没有在分配的超时 00:01:00 内完成。分配给该操作的时间可能是更长超时的一部分。

#2


能连上生服务吗?

#3


谢谢二楼,
    能连上。

#4


标记看结果

#5


四楼,您的意思是?我没有明白

#6


wcf服务端跟客户端在同一台机器上运行,可以正常使用,只要分开就行说,说什么超时之类的问题?

继续求解。。。。

#7


服务是什么Host,客户端是什么?

#8


配置文件加上


    <bindings>
      <netTcpBinding>
        <binding name="netTcpBindingSmiple" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:00:05" openTimeout="00:00:02" receiveTimeout="05:05:05" sendTimeout="00:03:30">          
       

        </binding>
      </netTcpBinding>
    </bindings>

设置时间。

#9


服务是host 

 客户端引用的是wsdaulhttpbindig

谢谢8楼跟9楼

8楼的方式我加着呢,不行

#10


谢谢几位的回答。

  我比较想不明白的是,当 wcf服务  与  客户放在同一台机器上可以正常运行呀,
为什么我把服务端放到服务器上就不行呀?

#11


你的是IIS Host呗。(host也有好几种)

(1)检查下服务器防火墙是不是开着?客户端通过浏览器能否取得WSDL?
(2)客户端app.config里的服务端的IP地址修改了吗?

#12


另外 wsdaulhttpbindig 要配两个地址。

#13


引用 12 楼 fangxinggood 的回复:
另外 wsdaulhttpbindig 要配两个地址。



谢谢您的回答,

#14



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="ClassLibrary1.Services" behaviorConfiguration="serviceBehaviors">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://192.168.1.100:8900"/>
            <add baseAddress="http://192.168.1.100:9900"/>
          </baseAddresses>
        </host>
        <endpoint address="Services" contract="ClassLibrary1.IServices" binding="wsDualHttpBinding" bindingConfiguration="wsDualService"/>
        <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehaviors">
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceMetadata httpGetEnabled="true"/>
          
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsDualHttpBinding>
        <binding name="wsDualService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" maxReceivedMessageSize="50000" sendTimeout="00:01:00" maxBufferPoolSize="50000">
          <security mode="None"></security>
        </binding>
      </wsDualHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>




///下面是服务代码
 using (ServiceHost host = new ServiceHost(typeof(Services)))
            {
                host.Open();
                host.Opened += delegate {Console.WriteLine("aucceed"); };
                Console.WriteLine("aucceed");
                Console.ReadKey();
            }


客户端口是用自动引用服务的,不用手动修改IP之类的设置吧,

#15


哦,你用的是Console Host,主要检查下服务端的防火墙是否关闭掉了吧。
服务端是 192.168.1.100 吧?

http://blog.csdn.net/fangxinggood/article/details/6142861

#16


恩,其实我原来是用的winform ,不行,我现在又在用控制台来试呢,

是100

#17


引用 15 楼 fangxinggood 的回复:
哦,你用的是Console Host,主要检查下服务端的防火墙是否关闭掉了吧。
服务端是 192.168.1.100 吧?

http://blog.csdn.net/fangxinggood/article/details/6142861


谢谢您,
  请问您还有别的办法吗?我都服了我的这个wcf了呀,哎..

#18


直接用 netTcpBinding 呀,也支持双工。

刚才上面说的几个检查项目都没问题?客户端在浏览器里敲wsdl能访问?

#19


引用 18 楼 fangxinggood 的回复:
直接用 netTcpBinding 呀,也支持双工。

刚才上面说的几个检查项目都没问题?客户端在浏览器里敲wsdl能访问?

谢谢您的回答。

检查了,没有问题(因为在同一台机器是可以正常访问的(服务与客户端)。

浏览器里敲  http://192.168.1.100:9900/?wsdl  也可以显示出来。

#20


那就是瞎子摸象了。。。

看看这篇文章是否有帮助:

http://www.cnblogs.com/artech/archive/2007/03/29/692032.html

#21


引用 20 楼 fangxinggood 的回复:
那就是瞎子摸象了。。。

看看这篇文章是否有帮助:

http://www.cnblogs.com/artech/archive/2007/03/29/692032.html


谢谢您的回答,
  我的wcf目前还没有用到双向通信的呢,只是我现这样设计的,我换成basichttpbinding就可以了,不过我还是要用双向通信的,我自己再写一个小的demo。
再次谢谢您。