Hello Group,
I am trying to get to the data in a custom table in the iMIS database, we'll call TableY by way of an iMIS business object created via the Business Object Designer, we'll call BOY by way of the iMIS API.
The general direction I am trying to go is as follows (C#):
using Asi.iBO;
using Asi.LExicon;
using Asi.Business;
using (Asi.Security.SecurityContext.ImpersonateAnonymous())
{
BusinessContainer container = new BusinessContainer("cdmCustom");
BusinessController controller = BusinessController.NewBusinessController(container, "BOY");
}
I have the following dll's referenced in my project:
Asi
Asi.iBO
Asi.Lexicon
Asi.Log4Net
Asi.Membership
log4net
Based on a discussion in another topic, I've also added what I think are the necessary log4net params in the web.config file. I've also added a call to iboAdmin.InitializeSystem(); in my Global.asax Application_Start event handler.
The problem happens when I call NewBusinessController(...). I am getting an Asi.Data.DataServerCredentialsException: Valid credentials must be provided by the application principal exception.
First question is if this is the proper way to attempt accessing data in a custom table from the API. Second, if so then what am I doing wrong and if not so then what approach should I take? I'm still quite new when it comes to iMIS development so any help is much appreciated.
Hi, When you use
Hi,
When you use ImpersonateAnonymous method make sure from your web/app config file Authenticate.Anonymous.Allow set to true also you must ste the anonymous user id as "GUEST"
<iMIS>
<SystemParams>
<add key="Authenticate.Anonymous.Allow" value="true"/>
<add key="Authenticate.Anonymous.UserId" value="GUEST"/>
<add key="Authenticate.PersistLogin.Allow" value="true"/>
<add key="Authenticate.PersistLogin.Minutes" value="0"/>
<add key="Authenticate.SecureLoginPage" value="false"/>
<add key="Authenticate.WindowsIdentity.Allow" value="true"/>
<add key="Browser.DisableContextMenu" value="true"/>
......
</SystemParams>
<log4net>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="..\\Asi.WebRoot.log"/>
<appendToFile value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff} %p %t %c - %m%n"/>
</layout>
</appender>
<root>
<level value="ERROR"/>
<appender-ref ref="FileAppender"/>
</root>
</log4net>
</iMIS>