70 lines
No EOL
1.9 KiB
C#
70 lines
No EOL
1.9 KiB
C#
using System;
|
|
using System.ServiceModel;
|
|
using System.Web.Http;
|
|
using ULA.Cathay.Credito.UltimusAudit;
|
|
using Ultimus.Utilitarios;
|
|
|
|
namespace ULA.Cathay.Credito.ControllersWebApi
|
|
{
|
|
public class ApiBaseController : ApiController
|
|
{
|
|
public string ProcessName
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public int Incident
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public string Step
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
private WSHttpBinding UltimusAudit_WSHttpBinding
|
|
{
|
|
get
|
|
{
|
|
WSHttpBinding tmp = new WSHttpBinding();
|
|
tmp.Security.Mode = SecurityMode.None;
|
|
tmp.MaxReceivedMessageSize = int.MaxValue;
|
|
tmp.MaxBufferPoolSize = int.MaxValue;
|
|
HttpTransportSecurity security = new HttpTransportSecurity();
|
|
security.ClientCredentialType = HttpClientCredentialType.None;
|
|
tmp.Security.Transport = security;
|
|
return tmp;
|
|
}
|
|
}
|
|
|
|
private EndpointAddress UltimusAudit_EndpointAddress
|
|
{
|
|
get
|
|
{
|
|
UltimusLogs logs = new UltimusLogs("UltimusAudit");
|
|
EndpointAddress tmp = null;
|
|
try
|
|
{
|
|
string url = new ObtieneParametros().GetValueKeyRegedit("UltimusAuditUrl", false);
|
|
tmp = new EndpointAddress(url);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logs.Error(ex);
|
|
}
|
|
return tmp;
|
|
}
|
|
}
|
|
|
|
public void AuditStep()
|
|
{
|
|
using (UltimusAuditClient client = new UltimusAuditClient(UltimusAudit_WSHttpBinding,UltimusAudit_EndpointAddress))
|
|
{
|
|
client.AuditProcessAsync(ProcessName, Step, Incident);
|
|
}
|
|
}
|
|
}
|
|
} |