How to Make an Access Databases WSDL (Work In Progress)
32bit notes
Initially you will need to make sure that the IIS Instance that will be running your WSDL to allow 32 bit applications. There are lots of great links on the net for this, mainly it is
Right click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool.
Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode).
Click OK.
WSDL Project - I choose File, New Website. Then choose Asp.net Empty Web Site.
All WSDL Methods that you would call need to have the WebMethod Attribute like below. Note that you need a "myConnection" entry in your connection strings section of the webconfig. I use the connection string found at http://www.connectionstrings.com/access/
The class below is an example of how to get some data going. This belongs in an ASMX(Webservice) file. Set this file as your start page.
Code:
Imports System.Web
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.Services
Imports System.Web.Services.Protocols
Public Class Service1
Inherits System.Web.Services.WebService
<System.Web.Services.WebMethod(BufferResponse:=False)> _
Public Function GetSomeData() As String
Dim strSQL As String = String.Format("Select * from table")
Dim cmd As New OleDbCommand(strSQL)
Return GetData(cmd).GetXml
End Function
Private Function GetData(ByVal cmd As OleDbCommand) As DataSet
Dim strConnstring As String = ConfigurationManager.ConnectionStrings("myConnection").ConnectionString
Dim ds As New DataSet
Using con As New OleDbConnection(strConnstring)
Using oda As New OleDbDataAdapter(cmd.CommandText, con)
Try
oda.Fill(ds)
Catch ex As Exception
If System.Diagnostics.Debugger.IsAttached Then
System.Diagnostics.Debugger.Break()
else
end if
End Try
End Using
End Using
Return ds
End Function
End Class
When you start debugging the application in a browser you can use the invoke button to return data.