我正在关注一个教程来创建一个使用datagrid并从表中提取数据的silverlight web应用程序,但我一直收到的服务器错误只是NotFound而没有进一步的细节。不知道如何跟踪错误。silverlight应用程序 - 服务器错误没有找到
Imports System.ServiceModel
Imports System.ServiceModel.Activation
Public Class Service2
<OperationContract()>
Public Function DoWork() As List(Of RealTimeCount)
Try
Dim df As New DataClasses2DataContext
Dim counts = (From record In df.RealTimePostCounts Order By record.pollDate, record.boxFeed, record.boxCount Select record)
Dim list As New List(Of RealTimeCount)
For Each d In counts
list.Add(New RealTimeCount With {.getDate = d.pollDate, .boxItem = d.boxFeed, .boxSum = d.boxCount})
Next
Return list
Catch ex As Exception....
end try
end function
end class
Public Class MainPage
Inherits UserControl
Private WithEvents mservice As New ServiceReference1.Service2Client()
Public Sub New()
InitializeComponent()
End Sub
Private Sub btnLoad_Click
(ByVal sender As System.Object,
ByVal e As System.Windows.RoutedEventArgs) Handles btnLoad.Click
mservice.DoWorkAsync()
End Sub
Private Sub mservice_DoWorkCompleted
(ByVal sender As Object,
ByVal e As ServiceReference1.DoWorkCompletedEventArgs)
Handles mservice.DoWorkCompleted
DataGrid1.ItemsSource = e.Result
DataGrid1.Visibility = Windows.Visibility.Visible
End Sub
End Class
右键单击YourService.svc并选择在浏览器中查看。发生了什么? – Nario 2011-04-15 22:55:24
要测试此服务,您需要创建一个客户端并使用它来调用该服务。您可以使用命令行中的svcutil.exe工具使用以下语法执行此操作:..出现在浏览器中 – vbNewbie 2011-04-16 13:51:14