I have developed a windows application in VB.NET 2005. The application works fine, as intended. I am converting some of that application's functionality into a web service (again VB.NET 2005). The code is basically the same but it fails when running as a web service. The error is: error #5 Procedure call or argument is not valid.
Following is the snippet of code to the point of failure (session.init)
Any ideas anyone?
Following is the snippet of code to the point of failure (session.init)
Code:
'
' Open and Compose views used by this Order Entry module.
'
Function OpenAndComposeOrderViews(ByRef myResult As String) As Boolean
Dim tempText As String
Dim lCount, lIndex As Integer
Dim Status As Boolean
Dim errNo$, errSrc$, errDesc$, Msg$
'LogDebugMsg("IN OpenAndComposeOrderViews")
Try
ACCPACsession = New ACCPAC.Advantage.Session
Catch ex As Exception
tempText = "Error source: " & ex.Source & " Message: " & ex.Message
Utility.LogErrorMsg("20060421-11", "Function OpenAndComposeOrderViews", "Fatal error in New ACCPAC.Advantage.Session.", tempText)
myResult = "New ACCPAC.Advantage.Session failure. " & tempText
Return False
End Try
'LogDebugMsg("AFTER session")
Try
Status = ACCPACsession.Init("", "XX", "XX1000", "52A")
Catch ex As Exception
errNo$ = Str(Err.Number)
errSrc$ = Err.Source
errDesc$ = Err.Description
.
.
.
Any ideas anyone?