0 Replies - 2200 Views - Last Post: 14 November 2008 - 05:05 AM Rate Topic: -----

#1 takingthepith   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-November 08

Soapmapper error using MS Access + SOAP + Web Service

Post icon  Posted 14 November 2008 - 05:05 AM

Please help !!! I have two weeks to write an entire final year project and I need someone to do everything for me ARGHHHHHH !!!


I'm kidding of course.

Firstly I realise this may be the incorrect forum to use, but here's the issue...

I receive a little error message (see below) when using my ASP.NET Web service from MS Access (VBA).

Attached Image

The call is fine, and the Web method seems to complete its little job (very trivial, just a server-side DB insert, where the DB - an MDB to be precise - is also server-side), but on the way back I receive the error.

I've scoured the Web for clues/solution but to no avail.

Here is MyTestClass.asmx:

<%@ WebService Language="vb" Class="MyTestClass" %>

Imports System
Imports System.Web.Services
Imports System.Data.OleDb

Public Class MyTestClass :Inherits WebService

	<WebMethod()> Public Function AddItem ()
		Dim strAboutVBConn As String = _
			"Provider=Microsoft.Jet.OLEDB.4.0;" _
			& "Data Source=[myAbsoluteWebServerPath]/database/[MyDatabase].mdb"

		Dim ocmdAboutVBCommand As OleDbCommand
		Dim odtrAboutVBDataReader As OleDbDataReader

		ocmdAboutVBCommand = New OleDbCommand()
		With ocmdAboutVBCommand
			.Connection = New OleDbConnection(strAboutVBConn)
			.CommandText = "INSERT INTO tblMyTable (FieldOne) VALUES ('test')"
		End With

	End Function

End Class

In my MS Access app I have my Web service class, created for me by Web Service References Tool 2.0 and based on my Web serice.

I also have a simple method call to add an item triggered by a button on a form.

So, briefly we have:

Access (TestCall_Click)
---> Access (call AddItem on SoapClient30 object)
---> Web (process call to Web method AddItem)
---> Access (error caught by AuctionItemsErrorHandler*)

* here's the error handler method in VBA:

Private Sub AuctionItemsErrorHandler(str_Function As String)
	'This subroutine is the class error handler. It can be called from any class subroutine or function
	'when that subroutine or function encounters an error. Then, it will raise the error along with the
	'name of the calling subroutine or function.

	'SOAP Error
	If sc_AuctionItems.FaultCode <> "" Then
		Err.Raise vbObjectError, str_Function, sc_AuctionItems.FaultString
	'Non SOAP Error
		Err.Raise Err.Number, str_Function, Err.Description
	End If

End Sub

Let me know if any of these makes sense, and if you require more information.

Many thanks,


Is This A Good Question/Topic? 0
  • +

Page 1 of 1