Hi everyone. I have an issue with ACCPAC & Web Services. I created my own .NET 1.1 web services that connects up to ACCPAC (using ACCPAC's .NET classes) and adds an order. The problem I am having is due to some kind of permissions issue, and I cannot figure it out. When I call into my web service, I get the following:
SoapException 1.2803.6
It occurs when my web service tries to connect to the ACCPAC database, which resides on another server. The interesting thing is, it works when I move the code from my web service into a windows application!
I would appreciate if anybody could shed some light on what permissions I need to give! I've tried everything I can think of, including granting 'Everybody' permissions on the ..\Program Files\ACCPAC folder.
Thanks in advance,
Matt
------------------------------------------------------------
Here is the code that connects to ACCPAC:
Dim session As New ACCPAC.Advantage.Session
Dim link As ACCPAC.Advantage.DBLink
Dim appID As String
Dim programName As String
Dim appVersion As String
Dim userID As String
Dim password As String
Dim companyID As String
'retrieve appID, programName, appVersion, userID, password & companyID
session.Init("", appID, programName, appVersion)
session.Open(userID, password, companyID, System.DateTime.Now, 0)
link = _session.OpenDBLink(ACCPAC.Advantage.DBLinkType.Company, ACCPAC.Advantage.DBLinkFlags.ReadWrite)
------------------------------------------------------------
And here is the detailed stack trace:
Event Type: Error
Event Source: ExceptionManagerPublishedException
Event Category: None
Event ID: 0
Date: 1/26/2007
Time: 3:32:51 PM
User: N/A
Computer: ESI
Description:
General Information
*********************************************
Additional Info:
ExceptionManager.MachineName: ESI
ExceptionManager.TimeStamp: 1/26/2007 3:32:51 PM
ExceptionManager.FullName: Microsoft.ApplicationBlocks.ExceptionManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ExceptionManager.AppDomainName: /LM/W3SVC/1/Root/ROE/C-3-128143351711037280
ExceptionManager.ThreadIdentity:
ExceptionManager.WindowsIdentity: ESI\ASPNET
1) Exception Information
*********************************************
Exception Type: ACCPAC.Advantage.SessionException
Reason: NotSpecified
Message:
TargetSite: SessionInfo Init(Int32, System.String, System.String, System.String, System.String, System.String, Boolean)
HelpLink: NULL
Source: ACCPAC.Advantage.Server
StackTrace Information
*********************************************
at ACCPAC.Advantage.Server.Session.Init(Int32 key, String objectHandle, String appID, String pgmName, String appVersion, String clientID, Boolean checkStatus)
at ACCPAC.Advantage.Session.Init(String objectHandle, String appID, String programName, String appVersion)
at C.WebServices.Orders..ctor(String connectionString)
at C.WebServices.CServices.UploadOrder(Byte[] order)
2) Exception Information
*********************************************
Exception Type: System.Runtime.InteropServices.COMException
ErrorCode: -2147467259
Message: 1.2803.6
TargetSite: Void Init(Int32, System.String, System.String, System.String, System.String, System.String, Boolean, Boolean ByRef, Byte[] ByRef)
HelpLink: NULL
Source: ACCPAC.Server.1
StackTrace Information
*********************************************
at AccpacCOMSVR.AccpacSvrSessionClass.Init(Int32 Key, String ObjectHandle, String AppID, String ProgramName, String AppVersion, String ClientID, Boolean CheckStatus, Boolean& IsOpened, Byte[]& SessionInfo)
at ACCPAC.Advantage.Server.Session.Init(Int32 key, String objectHandle, String appID, String pgmName, String appVersion, String clientID, Boolean checkStatus)
SoapException 1.2803.6
It occurs when my web service tries to connect to the ACCPAC database, which resides on another server. The interesting thing is, it works when I move the code from my web service into a windows application!
I would appreciate if anybody could shed some light on what permissions I need to give! I've tried everything I can think of, including granting 'Everybody' permissions on the ..\Program Files\ACCPAC folder.
Thanks in advance,
Matt
------------------------------------------------------------
Here is the code that connects to ACCPAC:
Dim session As New ACCPAC.Advantage.Session
Dim link As ACCPAC.Advantage.DBLink
Dim appID As String
Dim programName As String
Dim appVersion As String
Dim userID As String
Dim password As String
Dim companyID As String
'retrieve appID, programName, appVersion, userID, password & companyID
session.Init("", appID, programName, appVersion)
session.Open(userID, password, companyID, System.DateTime.Now, 0)
link = _session.OpenDBLink(ACCPAC.Advantage.DBLinkType.Company, ACCPAC.Advantage.DBLinkFlags.ReadWrite)
------------------------------------------------------------
And here is the detailed stack trace:
Event Type: Error
Event Source: ExceptionManagerPublishedException
Event Category: None
Event ID: 0
Date: 1/26/2007
Time: 3:32:51 PM
User: N/A
Computer: ESI
Description:
General Information
*********************************************
Additional Info:
ExceptionManager.MachineName: ESI
ExceptionManager.TimeStamp: 1/26/2007 3:32:51 PM
ExceptionManager.FullName: Microsoft.ApplicationBlocks.ExceptionManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ExceptionManager.AppDomainName: /LM/W3SVC/1/Root/ROE/C-3-128143351711037280
ExceptionManager.ThreadIdentity:
ExceptionManager.WindowsIdentity: ESI\ASPNET
1) Exception Information
*********************************************
Exception Type: ACCPAC.Advantage.SessionException
Reason: NotSpecified
Message:
TargetSite: SessionInfo Init(Int32, System.String, System.String, System.String, System.String, System.String, Boolean)
HelpLink: NULL
Source: ACCPAC.Advantage.Server
StackTrace Information
*********************************************
at ACCPAC.Advantage.Server.Session.Init(Int32 key, String objectHandle, String appID, String pgmName, String appVersion, String clientID, Boolean checkStatus)
at ACCPAC.Advantage.Session.Init(String objectHandle, String appID, String programName, String appVersion)
at C.WebServices.Orders..ctor(String connectionString)
at C.WebServices.CServices.UploadOrder(Byte[] order)
2) Exception Information
*********************************************
Exception Type: System.Runtime.InteropServices.COMException
ErrorCode: -2147467259
Message: 1.2803.6
TargetSite: Void Init(Int32, System.String, System.String, System.String, System.String, System.String, Boolean, Boolean ByRef, Byte[] ByRef)
HelpLink: NULL
Source: ACCPAC.Server.1
StackTrace Information
*********************************************
at AccpacCOMSVR.AccpacSvrSessionClass.Init(Int32 Key, String ObjectHandle, String AppID, String ProgramName, String AppVersion, String ClientID, Boolean CheckStatus, Boolean& IsOpened, Byte[]& SessionInfo)
at ACCPAC.Advantage.Server.Session.Init(Int32 key, String objectHandle, String appID, String pgmName, String appVersion, String clientID, Boolean checkStatus)