2010-07-01 5 views
1

여러 WCF 끝점을 노출하는 기존 Windows 서비스에 연결하려고합니다. 내가 염려하는 것은 Silverlight 4 응용 프로그램과 대화하는 것입니다. 여기에 (섹션이 우리가 관심있어 적어도) 서비스의 config 파일 :이 서비스는 자체 호스팅Silverlight 4 어셈블리에서 WSDualHttpBinding입니까?

<system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="EnableMetadataBehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="EnableMetadataBehavior" name="Cad.Server.ConsoleCustomerServicePortal"> 
     <endpoint address="ConsoleCustomerServicePortal" binding="wsDualHttpBinding" 
      name="CustomerServiceEndpoint" contract="Cad.Net.Wcf.Contracts.CustomerService.ICustomerService" /> 
     <endpoint address="" behaviorConfiguration="webHttpBehavior" 
      binding="webHttpBinding" name="CustomerServiceSilverlightEndpoint" 
      contract="Cad.Net.Wcf.Contracts.Silverlight.IClientAccessPolicy" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:31313/" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    </system.serviceModel> 

는 다음과 같은 서비스 호스트 시작 :

Public Sub StartServiceHost() 
     'Publish the Wcf Service endpoint. 
     Try 
     shRccUserInterface = New ServiceHost(Me._CsService) 
     AddHandler shRccUserInterface.Faulted, AddressOf OnChannelFaulted 
     AddHandler shRccUserInterface.Closed, AddressOf OnChannelClosed 
     AddHandler shRccUserInterface.Opened, AddressOf OnChannelOpened 
     AddHandler shRccUserInterface.Opening, AddressOf OnChannelOpening 
     AddHandler shRccUserInterface.UnknownMessageReceived, AddressOf OnUnknownMessageReceived 

     shRccUserInterface.Open() 
     Me.blnServiceHostOpen = True 
     RaiseEvent ServiceHostOpenEvent(Me) 
     Catch exWcf As Exception 
     log.Write_Error("CsGuiComm", "StartServiceHost()", exWcf) 
     RaiseEvent SendUtaEmailEvent("Wcf Problem", exWcf.ToString, System.Net.Mail.MailPriority.High) 
     End Try 
    End Sub 

내가를 생성 할 수 있습니다

<configuration /> 

나는 검색 및 F : 잘 실버 라이트 응용 프로그램에서 서비스 참조는하지만 때문에 서비스가 설정 방식, 내 ServiceReferences.ClientConfig 파일은 다음과 같다 이를 해결하기위한 방법은 프록시에 바인딩 및 끝점 정보를 제공하는 것입니다 (http://tomasz.janczuk.org/2009/07/pubsub-sample-using-http-polling-duplex.html). 새로운 EndpointAddress를 새로운 WSDualHttpBinding (AS ("http://localhost:31313/ConsoleCustomerServicePortal") 희미한 _binding)

새로운 CustomerService.CsServiceReference.CustomerServiceClient (_binding, _address)으로 희미한 _Client

으로

희미한 _address : 그 예를 바탕으로, 나는 쓰기를 시도

Dim _RequestType As CustomerService.CsServiceReference.VehicleSearchType = CsServiceReference.VehicleSearchType.Badge 
Dim strSearchValue As String = String.Empty 

... 

AddHandler _Client.GetVehicleCompleted, AddressOf OnFindVehicleCompleted 
_Client.GetVehicleAsync(CurrentUserName(), strSearchValue, _RequestType) 

그러나 WSDualHttpBinding은 Silverlight 4 어셈블리에 없습니다. 내가 놓친 게 있니? 서비스 참조를 생성하거나 Silverlight 응용 프로그램에서 WSDualHttpBinding에 대한 참조를 가져 오거나 다른 바인딩 (PollingDuplexHttpBinding)으로 전환해야 할 때 ServiceReferences.ClientConfig를 채우려면 어떻게해야합니까?

답변

1

이 바인딩은 Silverlight Framework에 없습니다. 가장 기본적인 바인딩 만 있습니다.

0

WSDualHttpBinding 등급 :

안전하고 상호 운용이이 서비스와 클라이언트 모두가 메시지를 보내고받을 수있는 양방향 서비스 계약과 함께 사용하도록 설계 바인딩.

네임 스페이스 :는 system.serviceModel
어셈블리 : (하여 System.ServiceModel.dll에서)는 system.serviceModel

이 당신이 찾고있는 무엇인가?

System.ServiceModel에 대한 참조를 추가하면 작동합니다.

+0

이것은 매우 이상합니다. Silverlight 4 응용 프로그램에 약 7 번 정도 있는지 확인했습니다. \ 프로그램 파일 \ 참조 어셈블리 \ 마이크로 소프트 \ 프레임 워크 \ 실버 \ 4.0 \하여 System.ServiceModel.dll 과에서 안 하나 : C : 그것은 C에서 어셈블리를 참조 \ 프로그램 파일 \ 참조 어셈블리 \ Microsoft \ Framework \ v3.0 \ System.ServiceModel.dll – Jasonthemasonkcch