' 注意: 使用上下文菜单上的“重命名”命令可以同时更改代码、svc 和配置文件中的类名“Service1”。 ' 注意: 为了启动 WCF 测试客户端以测试此服务,请在解决方案资源管理器中选择 Service1.svc 或 Service1.svc.vb,然后开始调试。 Public Class Service1 Implements IService1 Public Sub New() End Sub Public Function GetData(ByVal value As Integer) As String Implements IService1.GetData Return String.Format("You entered: {0}", value) End Function Public Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType Implements IService1.GetDataUsingDataContract If composite Is Nothing Then Throw New ArgumentNullException("composite") End If If composite.BoolValue Then composite.StringValue &= "Suffix" End If Return composite End Function End Class