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