Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.ServiceModel
- ' NOTE: You can use the "Rename" command on the context menu to change the interface name "IService1" in both code and config file together.
- <ServiceContract()>
- Public Interface IService1
- <OperationContract()>
- <WebGet(UriTemplate:="estudiantes", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Bare)>
- Function ObtenerEstudiantes() As List(Of Estudiante)
- End Interface
- Imports System.ServiceModel.Activation
- ' NOTE: You can use the "Rename" command on the context menu to change the class name "Service1" in code, svc and config file together.
- ' NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.vb at the Solution Explorer and start debugging.
- <AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
- Public Class Service1
- Implements IService1
- Public Function ObtenerEstudiantes() As List(Of Estudiante) Implements IService1.ObtenerEstudiantes
- Dim resultado As New List(Of Estudiante)
- Dim e1 As New Estudiante()
- e1.Codigo = "1111"
- e1.Nombre = "Alice"
- resultado.Add(e1)
- Dim e2 As New Estudiante()
- e2.Codigo = "2222"
- e2.Nombre = "Bob"
- resultado.Add(e2)
- Return resultado
- End Function
- End Class
- Public Class Estudiante
- Public Property Codigo As String
- Public Property Nombre As String
- End Class
- Public Class Estudiante
- Public Property Codigo As String
- Public Property Nombre As String
- End Class
Advertisement
Add Comment
Please, Sign In to add comment