(I는 모두 작업을 한 후 필요 사촌 적어도이 내 WCF 기반) : 내 컴퓨터에서 잘 작동하지만 것 http://www.eggheadcafe.com/tutorials/wcf/b5ada8df-58c5-492f-b368-457b3a4f137c/notify-client-applications-using-wcf-callbacks.aspx인터넷을 통해 WCF 이중 서비스를 사용하는 방법은 무엇입니까? 나는이 튜토리얼을 따라
나는 인터넷을 통해 그것을 사용해야합니다. 이 작업을 시도하는 동안 netTcpBiding을 사용하는 것이 더 좋습니다 (인터넷을 통해)라고 들었습니다.
온라인으로 클라이언트 수를 알고있는 서버를 갖게됩니다. 서버의 IIS에 WFC 서비스가 필요하고 Windows 서비스에서이를 소비하고이를 알립니다. 나는 콜백 서버가 언젠가는 클라이언트에서 몇 가지 명령을 실행할 수 있어야합니다 coz 필요합니다.
누구든지 나를 도울 수 있다면 매우 기쁠 것입니다. 사전에
감사합니다,
편집 :
자신을 명확 만들기 : 나는 그냥 인터넷을 통해 작동 할 수 없었다. 어떻게하면 내 구성 (Web.config e App.config)을 변경하여 netTcpBinding을 사용하고 인터넷을 통해 작업 할 수 있는지 보여 줄 수 있습니까? 다시
감사합니다,
편집 2 :이
내 WCFServiceApplication 나의의 Web.config은 다음과 같습니다
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPCWatcherWCFService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="TiT.PCWatcher.Server.WCFService.Services.PCWatcherWCFServiceBehavior" name="TiT.PCWatcher.Server.WCFService.Services.PCWatcherWCFService">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPCWatcherWCFService" contract="TiT.PCWatcher.Server.WCFService.Interfaces.IPCWatcherWCFService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TiT.PCWatcher.Server.WCFService.Services.PCWatcherWCFServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
내 윈도우 서비스에
내의 App.config입니다 :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPCWatcherWCFService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:25145/Services/PCWatcherWCFService.svc"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPCWatcherWCFService"
contract="PCWatcherWCFServiceReference.IPCWatcherWCFService"
name="WSDualHttpBinding_IPCWatcherWCFService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
그냥 netTcpBinding으로 변경하면 작동하지 않습니다 ...
하지만 인터넷을 통해 실행할 수있을만큼 기뻐할 것입니다 ... IIS에 WCFService를 게시했습니다. 링크 :
https://www2.tcenter.com.br/monitor/PCWatcherWCFService.svc
또는 그냥 CONFIGS는 인터넷을 통해 작동하도록 그 한 정도로 변화
http://www2.tcenter.com.br:8080/monitor/PCWatcherWCFService.svc
? 내가 말했듯이, 그것은 잘 작동합니다. 나는 그것이 작동 whould 위에 바로 URL의 중 하나에 클라이언트의 엔드 포인트 주소를 변경 생각하지만,당신은 호스트에게 WPF에서 서비스를 연결 예제 ...하지 않았다. 내 cenario에 적용되는지 모르겠다 ...
나는 듀얼 HTTP 바인딩을 계속 사용한다고 생각하지 않는다. 포트 포워딩이 내 요구에 잘 맞다고 생각하지 않는다. 나는 많이 가질 수있다. 하나의 인트라넷에있는 클라이언트 중 라우터가 라우터를 결정하는 데 아무런 문제가 없다는 정보를 보내겠습니까? 라우터가 똑같은 포트를 통해 내 웹 서버에 연결되는 각각의 모든 컴퓨터에 정확하게 응답하도록하는 방법이 있습니까?!읽기에 대한
감사 : 사전에
고마워, 21/06/2012에
편집 (단지 히히히, 요청). LAN에서 netTcpBinding을 사용하여 서비스를 사용할 수 없습니다. 나는 나의 cenario의 모의 샘플을 만들었습니다. here입니다. DualCommunicationTest라고합니다.
내가이 게시물을 시작했을 때, 저는이 세나리온을 인터넷에서 실행하는 방법을 알고 싶었습니다. 그냥. 여기에 게시하기 전에 솔루션을 검색하는 동안 netTcpBinding이 더 좋다고 읽었습니다. 그래서 나는 그것에 대해 물었다. 그것은 단지 부작용이었습니다.
그래서 ... 포스트에 내 현재의 요구 사항은 다음과 같습니다 어떻게 인터넷에 the sample i developed를 사용 할 수 있습니다.또는
어떻게 netTcpBinding과 the sample i developed 작업을 확인하고 인터넷을 사용할 수 있습니다. (나는 꽤 확신한다. Clunky Coder은 인터넷과 IIS에 net.tcp를 게시하는 방법에 대해 두 번째 부분을 가르쳐 주었고, 덕분에 많이 감사했다. 그러나 나는 아직 테스트 할 수 없었다. 왜냐하면 나는 ' 아직 netTcp를하지 마라.)만일 내가 분명하지 않으면 미안하다, 나의 영어는 그렇게 좋지 않다. 다시 한번 고맙다.
참 좋은 독서가 ... 네, netTcp 또는 wsDual을 사용한다면 더 이상 알지 못합니다.하지만 작동하도록 도와 주시겠습니까? 위의 링크에서 구현 된 예제를 작업에 넣는 것만으로도 행복합니다 ... –
@TanielianBarreira, 방금 기사를 보았습니다. 문제가 정확히 무엇인가요? 간단한 채팅 서비스를 구현하고 있습니다. WCF의 콜백에 대한 예제가 많이 있습니다. 아이디어의 요지는 클라이언트가 서비스에서 일부 작업을 호출하고 서비스가 클라이언트에서 메소드를 호출 할 수 있다는 것입니다 (콜백 임). 따라서 클라이언트는 일시적으로 서버 자체와 같을 것입니다. 'ChatService'의 메소드는 클라이언트가 서버에서 호출하는 메소드이고,'IChatServiceCallback'의 메소드는 서비스가 클라이언트에서 호출하는 메소드입니다. –
@TanielianBarreira가 내 업데이트를 확인합니다. –