masyanto

AllService.svc.vb

Apr 20th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.98 KB | None | 0 0
  1. ' NOTE: You can use the "Rename" command on the context menu to change the class name "Service1" in code, svc and config file together.
  2. Public Class Service1
  3.     Implements AllService
  4.  
  5.     Public Sub New()
  6.     End Sub
  7.  
  8.     Public Function GetData(ByVal value As Integer) As String Implements AllService.GetData
  9.         Return String.Format("You entered: {0}", value)
  10.     End Function
  11.  
  12.     Public Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType Implements AllService.GetDataUsingDataContract
  13.         If composite Is Nothing Then
  14.             Throw New ArgumentNullException("composite")
  15.         End If
  16.         If composite.BoolValue Then
  17.             composite.StringValue &= "Suffix"
  18.         End If
  19.         Return composite
  20.     End Function
  21.     Public Function Tambah(ByVal param1 As String, ByVal param2 As String) As String Implements AllService.Tambah
  22.         Return String.Format("{0}", Val(param1) + Val(param2))
  23.     End Function
  24. End Class
Add Comment
Please, Sign In to add comment