Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
VB6 --> ASP.Net issue
Joe_Bryant
The following ASP.NET code was copied from a VB6 desktop application...'Initialize variablesDim status As LongDim errmsg As String'Contains attributes for the Enterprise WorkspaceDim vLibraryInfo As Long'Assign values to the login vars to be used by the'LL_SessionAllocEx functionSetLLVariables()LL_ValueAlloc(vLibraryInfo)' Initialize LAPIstatus = LL_Initialize(LL_HEADER_VERSION)lblMsg.Text = "LL_Initialize status: " & status & "
"'An LLSession object must be created and passed to the LAPI object 'constructor before any other method can be calledTry 'status = LL_SessionAllocEx(ll_session, ll_server, 2099, dbUserName, ll_login, ll_password, 0) status = LL_SessionAlloc(ll_session, ll_server, 2099, dbUserName, ll_login, ll_password) status = LL_AccessEnterpriseWS(ll_session, vLibraryInfo)Catch llErr As Exception Response.Write(llErr.Message & " status: " & status)End Try...works fine until it gets to the status = LL_AccessEnterpriseWS line The error generated is...'Object reference not set to an instance of an object. Value of status var at error time: 539869016068457451 I got the same error message on the status = LL_SessionAllocEx line until I removed the "Ex" from the end.Tell me what I need to do to make this work in ASP.Net. Thanks,
Find more posts tagged with
Comments
Louis_Routhier
Since you're now using .Net framework, I think you should better use the .NET API directly instead of the COM interop.To do this, in your .NET project, go to the project menu and select add reference. Then, browse to the place where LAPI is installed and select LAPI_NETs (or LAPI_NETp depending on your LAPI version and what you want to do with it). LAPI_NETs is a version signed so that you could deploy it to the GAC. If you do deploy it in GAC, you must be aware that to use HTTP tunnelling with impersonation, you must have LLKernel.dll and LAPI_BASE.dll in your path variable.So, to do what you're looking for here, you would get some code looking like:Dim Sess as New LLSession(ll_server, 2099, dbUserName, ll_login, ll_password)Dim DAPI as New LAPI_DOCUMENTS(Sess)Dim status as integer = DAPI.AccessPersonalWS(vLibraryInfo)if status <> 0 then'Error handlingend ifThis code isn't tested but should be a close solution. Also, I would recommend that if you have some time, you develop a more object oriented interface instead of having many stateless global/local variables.
Louis_Routhier
Did it worked?
Joe_Bryant
Thanks for your reply Louis.