0
SQL Server DB의 테이블에 액세스하기 위해 WCF 서비스가있는 Silverlight 응용 프로그램이 있습니다. 튜토리얼의 모든 코드를 복사하여 데스크탑에서 실행했습니다. 모든 것이 잘로드되지만 SQL Server 데이터를로드하지 못합니다. 다른 게시물에서는 http://localhost:PortNumber/Service1.svc이 문제가되고 다른 사용자는 관찰 가능 콜렉션을 사용하는 것에 대해 이야기하면서 servive를 배포해야합니다. 문제가 될 수있는 것과 해결 방법에 대한 설명이있는 사람이 있습니까?silverlight DataGrid에 데이터가 표시되지 않습니다.
Imports System.ServiceModel
Imports System.ServiceModel.Activation
공공 클래스 서비스 1
<OperationContract()>
Public Function GetPostCounts() As List(Of RealTimePostCount)
' Add your operation implementation here
Dim db As New DataClasses1DataContext
Dim posts = (From record In db.RealTimePostCounts Order By record.boxCount, record.boxFeed, record.pollDate Select record)
Dim list As New List(Of RealTimePostCount)
For Each p In posts
list.Add(New RealTimePostCount With {.boxCount = p.boxCount, .boxFeed = p.boxFeed, .pollDate = p.pollDate})
Next
Return list
End Function
' Add more operations here and mark them with <OperationContract()>
최종 클래스
servicerefernces..clientconfig
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Service1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:12018/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
name="BasicHttpBinding_Service1" />
</client>
</system.serviceModel>
에 testclient와 함께 다음 오류가 발생했습니다. 서비스를 호출하지 못했습니다. 가능한 원인 : 서비스가 오프라인이거나 액세스 할 수 없습니다. 클라이언트 측 구성이 프록시와 일치하지 않습니다. 기존 프록시가 유효하지 않습니다. 자세한 내용은 스택 추적을 참조하십시오. 새 프록시를 시작하거나 기본 구성으로 복원하거나 서비스를 새로 고침하여 복구를 시도 할 수 있습니다. – vbNewbie
이제 더 자세한 오류가 있습니다. 여기에서 시작하십시오 http://stackoverflow.com/questions/2671113/c-wcf-failed-to-invoke-the-service – agradl