Imports System
Imports System.ServiceModel
Imports System.Runtime.Serialization
' A WCF service consists of a contract (defined below as IMyService),
' a class which implements that interface (see MyService),
' and configuration entries that specify behaviors associated with
' that implementation (see <system.serviceModel> in web.config)
<ServiceContract()> _
Public Interface IMyService
<OperationContract()> _
Function MyOperation1(ByVal myValue1 As String) As String
<OperationContract()> _
Function MyOperation2(ByVal dataContractValue1 As DataContract1) As String
End Interface
Public Class MyService
Implements IMyService
Public Function MyOperation1(ByVal myValue1 As String) As String Implements
IMyService.MyOperation1
Return "Hello: " + myValue1
End Function
Public Function MyOperation2(ByVal dataContractValue1 As DataContract1) As String Implements IMyService.MyOperation2
Return "Hello: " + dataContractValue1.FirstName
End Function
End Class
<DataContract()> _
Public Class DataContract1
Private m_firstName As String
Private m_lastName As String
Public Property FirstName() As String
Get
Return m_firstName
End Get
Set(ByVal value As String)
m_firstName = value
End Set
End Property
Public Property LastName() As String
Get
Return m_lastName
End Get
Set(ByVal value As String)
m_lastName = value
End Set
End Property
End Class
|