Description
The Web Services platforms represents the evolution of past distributed component technologies. They really were the result of developments and companies struggling with the various interoperability
issues that were common with other technologies. Web Services aren’t the only distributed technology available but certainly the most prevalent.
In this screencast Thom takes a look at some of the more important changes within
the Web Services infrastructure using Visual Studio 2005. These include the addition of the WS-I basic profile, and building typed datasets.
Download
Right click or Alt+Enter to download this episode
The Discussion
-
Khamul One question: localhost.com? What the?
-
guercheLE Dear Thom,
I created a sample quite similar to yours, but using Microsoft Visual Web Developer 2005 Express Edition and Microsoft Visual Basic 2005 Express Edition. Moreover, I tried to implement a way to client(s) send changes back to server, through EmployeesUpdate method, but it is not working. Would you mind looking at code below and pinpointing what I have done wrong?
Regards,
Luciano Evaristo Guerche
Taboão da Serra, SP, Brazil'Service.vb
'-------------------------------------------------------------------------------
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols<System.Web.Services.WebService(Namespace:="http://www.rabobank.com/dataaccess/adventureworks", Description:="Provides data access to Adventureworks database")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
Inherits System.Web.Services.WebService<WebMethod()> _
Public Function EmployeesGetData() As AdventureWorks.EmployeesDataTable
Return CType(New AdventureWorksTableAdapters.EmployeesTableAdapter, AdventureWorksTableAdapters.EmployeesTableAdapter).GetData()
End Function<WebMethod()> _
Public Function EmployeesUpdate(ByVal employeeDataTable As AdventureWorks.EmployeesDataTable) As Integer
Return CType(New AdventureWorksTableAdapters.EmployeesTableAdapter, AdventureWorksTableAdapters.EmployeesTableAdapter).Update(employeeDataTable)
End Function
End Class
'EmployeesForm.vb
'-------------------------------------------------------------------------------
Public Class EmployeesForm
Private Sub EmployeesForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.AdventureWorks.Merge(CType(New Global.WindowsApplication1.localhost.Service, Global.WindowsApplication1.localhost.Service).EmployeesGetData())
End SubPrivate Sub EmployeesBindingNavigatorRefreshItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.AdventureWorks.Merge(CType(New Global.WindowsApplication1.localhost.Service, Global.WindowsApplication1.localhost.Service).EmployeesGetData())
End SubPrivate Sub EmployeesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
CType(New Global.WindowsApplication1.localhost.Service, Global.WindowsApplication1.localhost.Service).EmployeesUpdate(Me.AdventureWorks.Employees)
End Sub
End Class'Reference.vb
'-------------------------------------------------------------------------------
Option Strict Off
Option Explicit OnImports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization'
'This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.42.
'
Namespace localhost
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="ServiceSoap", [Namespace]:="http://www.rabobank.com/dataaccess/adventureworks")> _
Partial Public Class Service
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol'abridged for brevity's sake...
'''<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.rabobank.com/dataaccess/adventureworks/EmployeesUpdate", RequestNamespace:="http://www.rabobank.com/dataaccess/adventureworks", ResponseNamespace:="http://www.rabobank.com/dataaccess/adventureworks", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function EmployeesUpdate(ByVal employeeDataTable As AdventureWorks.EmployeesDataTable) As Integer
Dim results() As Object = Me.Invoke("EmployeesUpdate", New Object() {employeeDataTable})
Return CType(results(0),Integer)
End Function
End Class
End Namespace
More episodes in this series
Looking at Themes and Skins
Related episodes
DataBinding to a Web Service in ASP.NET 2.0

MIX'07 video player sample - with all the new stuff

Xml Editor: Creating Code Snippets

smarxwear: ASP.NET AJAX T-shirt demo

Scott Guthrie - MIX07, Work, and Personal Details Revealed

Looking at the Mobile Controls
Drag and Drop Databinding in ASP.NET 2.0

Mashup 101: Virtual Earth and ASP.NET Atlas (Part II)

Mashup 101: Virtual Earth Map Control and AJAX (Part I)
