Overriding EndPoints at Runtime

  • Updated

Prerequisites:  A valid RuleSession
Namespaces: InRule.Runtime, InRule.Repository.EndPoints
Classes:   RuleSession, DatabaseConnection, SendMailServerDef, WebServiceDef
See Also: Retrieving a Rule Application, Creating a RuleSession

Setting the database endpoint

// Override InvoiceDB connection string
string connString = ConfigurationManager.ConnectionStrings["TestDb"].ConnectionString;
ruleSession.Overrides.OverrideDatabaseConnection("InvoiceDB", connString);
 
Setting the WebService endpoint

// Override the web service address
ruleSession.Overrides.OverrideWebServiceAddress("WebService1",
"http://localhost/MyWebService/service1.svc?wsdl");

// Override the web service MaxReceivedMessageSize
ruleSession.Overrides.OverrideWebServiceMaxReceivedMessageSize("WebService1", Int32.MaxValue);
 
Setting the Mail server endpoint

//Override the smtp server from the .config file setting
string server = ConfigurationManager.AppSettings["MailServer"];
ruleSession.Overrides.OverrideMailServerConnection("SmtpServer", server);

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.