Portada | Monotemáticos | Secciones | Desarrolladores | Comunidad | Servicios | Servicios profesionales | RSS
Desde 0 | HTML | CSS | ASP | PHP | AJAX | Javascript | Promoción de webs | Rentabilidad de webs
Directorio | Manuales | Scripts | FAQs | Programas | Artículos Copyleft | Actualidad | La Cosecha | Colabora
Registrarse | Vuestras páginas | Foros del web | Lista de correo | Boletín de novedades
Generador METAs | Compras | Busca cursos
Alojamiento | Dominios.es | Micropagos SMS | Buscadores | Patentes, marcas | Creación web | Multimedia | Videos
Desarrollo Freelance | Buscar proyectos | Buscar profesionales | Solicitar desarrollo

Desarrollo y consumo de un Web Services con Microsoft Visual Studio .Net


Vemos paso a paso como desarrollar un Web Services con Microsoft Visual Studio .Net.


26/11/04 - 1 Introducción.

El objetivo de la actividad es presentar fundamentos teóricos generales relativos a la tecnología de webservices, y como puede ser implementada en los escenarios más comunes con que nos encontraremos.

Como implementación, comenzaremos construyendo un webservice muy sencillo, el cual será testado a través del browser.

Desarrollaremos aplicaciones cliente (consumidoras) del Web Service, como:

  • Página ASP.Net
  • Aplicación Windows .Net
  • Aplicación Excel de Office XP
  • Aplicación de Internet Mobile
  • Aplicación Visual Basic 6.0


Requerimientos

Software

Servidor - Webservice

  • Windows 2000, XP, superior
  • Internet Information Service
  • .Net Framework (SDK)


Desarrollo Webservice

  • Visual Studio .Net

  • o
  • Notepad.


Cliente webservice (Consumidor)

  • MS SoapToolkit
  • Office XP
    o
  • Webservice referente toolkit (para creación del Proxy)


2 Implementación

Desarrollando un webservice

1.) En Visual Studio .Net, creamos un proyecto ASP.Net Webservices, llamado "WorkShopUDP_v1"


2.) Eliminar los comentarios (comilla simple) del método HelloWorld() de la clase - service1.
3.) Cambiamos el nombre de la "Service1" por "Saludo"

Antes:

Imports System.Web.Services

<WebService(Namespace := "http://tempuri.org/")> _
Public Class Service1
Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

Public Sub New()
MyBase.New()
'This call is required by the Web Services Designer.
InitializeComponent()

'Add your own initialization code after the InitializeComponent() call

End Sub

'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region

' WEB SERVICE EXAMPLE
' The HelloWorld() example service returns the string Hello World.
' To build, uncomment the following lines then save and build the project.
' To test this web service, ensure that the .asmx file is the start page
' and press F5.
'
'<WebMethod()> Public Function HelloWorld() As String
'HelloWorld = "Hello World"
'End Function

End Class


Después:

Imports System.Web.Services

<WebService(Namespace:="http://tempuri.org/")> _
Public Class Saludo
Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Web Services Designer.
InitializeComponent()

'Add your own initialization code after the InitializeComponent() call

End Sub

'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region

' WEB SERVICE EXAMPLE
' The HelloWorld() example service returns the string Hello World.
' To build, uncomment the following lines then save and build the project.
' To test this web service, ensure that the .asmx file is the start page
' and press F5.
' <WebMethod()> Public Function HelloWorld() As String
HelloWorld = "Hello World Marco"
End Function

End Class


4.) Cambiar el nombre del archivo "Service1.asmx" a "mensaje1.asmx" a través del solution Explorer.

Antes:


Después:


5.) Construir la solución.
Ejecutar: "Build Solution"
Menu: Build à "Build Solution", o bien, "Ctrl+Shift+B"
Verificar en IIS que en "Default Web Site" está el sitio http://localhost/WorkShopUDP_v1


3 Testing

Testing del webservice desde el browser

En el browser, abrir la dirección: http://localhost/WorkShopUDP_v1/mensaje1.asmx


Clickar sobre "HelloWorld"


Clickar "Invoke"


 Seguir navegando a partir aquí:
+ 1 manual relacionado
+ 2 categorias relacionadas
+ 1 comentario no revisado

 Autoría, licencia y acciones sobre este artículo



Informe de Benjamín González C.
Ingeniero de Sistemas

Atención: Copyright. Este artículo no se puede reproducir sin la autorización expresa del autor.

Versión imprimible Versión imprimible del artículo
Enviar artículo por e-mail Enviar artículo por e-mail
Añadir un comentario al artículo Publicar un comentario del artículo

Manuales relacionados con este artículo
Dentro de Servicios Web en plataforma .NET

Categorias relacionadas
A través de las categorías de nuestro directorio se pueden encontrar otro tipo de recursos relacionados con este artículo:
+ Entrar en XML
+ Entrar en .NET


 Comentarios sin revisar
Entre los comentarios no revisados puede haber algunos interesantes que se hayan enviado recientemente.
 Se ha encontrado un comentario sin revisar

Ver el comentario no revisadoVer los comentarios no revisados
Añadir un comentario al artículo Añadir un comentario del artículo



Enlaces:
Maestrosdelweb
  Ir arriba

Manuales relacionados
+Servicios Web en plataforma .NET
Categorías
+XML
+.NET

Lectura recomendada

Compra este libro en Agapea, la librería urgente a domicilio.

Tienda DesarrolloWeb

DesarrolloWeb.com | Copyright | Anunciese | Acerca de | Datos legales | Contacta | Por GuiarteMultimedia