本文整理汇总了C#中Service.StartCallableLoader方法的典型用法代码示例。如果您正苦于以下问题:C# Service.StartCallableLoader方法的具体用法?C# Service.StartCallableLoader怎么用?C# Service.StartCallableLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.StartCallableLoader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override int Execute(Object o, Hashtable inputData)
{
log.InfoFormat("Module {0} received {1} inputs.", name, inputData != null ? inputData.Count.ToString() : "no");
int retval = 0;
double duration = 0;
int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o);
if (inputData.Count > 0)
{
PerfTimer hpt = new PerfTimer();
hpt.Start();
if (IfResetOnEachRun)
ResetOutput();
DataTable dtOut = new DataTable();
try
{
log.InfoFormat("Setting up Geneva SOAP service call.");
string runrepSessionID = "";
Service webServ = new Service();
webServ.Url = Settings.Default.GenevaSoapUpdate_GenevaSoap_Service;
try
{
runrepSessionID = webServ.StartCallableLoader(
Settings.Default.Geneva_Port,
Settings.Default.Geneva_HostName,
Settings.Default.Geneva_Uid,
Settings.Default.Geneva_Password
);
}
catch (Exception ex)
{
log.Error(ex);
}
Hashtable transforms = GetTransforms();
XmlDocument sourceXdoc = new XmlDocument();
XmlDocument targetXdoc = new XmlDocument();
if (InputToProcess.CompareTo(String.Empty) != 0)
sourceXdoc = (XmlDocument)((Hashtable)inputData)[InputToProcess];
else
sourceXdoc = (XmlDocument)((Hashtable)inputData)[0];
if (sourceXdoc.DocumentElement.FirstChild.Name.CompareTo("InvestmentRecords") == 0)
sourceXdoc.InnerXml = sourceXdoc.InnerXml.Replace("http://www.advent.com/SchemaRevLevel248/Geneva", "http://www.advent.com/SchemaRevLevel371/Geneva");
XmlNode targetFC = sourceXdoc.FirstChild.CloneNode(true);
XmlNode newFC = targetXdoc.ImportNode(targetFC, true);
targetXdoc.AppendChild(newFC);
targetXdoc.DocumentElement.FirstChild.RemoveAll();
recCountTotal = sourceXdoc.FirstChild.FirstChild.ChildNodes.Count;
foreach (XmlNode investmentNode in sourceXdoc.FirstChild.FirstChild.ChildNodes)
{
string ticker = String.Empty;
string desc = String.Empty;
string exchCode = String.Empty;
string loaderAction = String.Empty;
string assetType = String.Empty;
foreach (XmlNode node in investmentNode.ChildNodes)
{
if (node.Name.CompareTo("AssetType") == 0)
{
loaderAction = String.Format("{0}_InsertUpdate", node.InnerXml);
assetType = node.InnerXml;
break;
}
}
//bail on null asset type
if (assetType.CompareTo(String.Empty) == 0) continue;
XmlNode newInvestmentNode = targetXdoc.CreateElement(loaderAction);
foreach (XmlNode node in investmentNode.ChildNodes)
{
if (transforms.ContainsKey(node.Name))
{
string[] newTags = transforms[node.Name].ToString().Split(',');
foreach (string targetTag in newTags)
{
//reassignments
if (node.Name.CompareTo("TICKER") == 0)
ticker = node.InnerXml;
else if (node.Name.CompareTo("NAME") == 0 && assetType.ToUpper().CompareTo("EQUITY") == 0)
desc = node.InnerXml;
else if (node.Name.CompareTo("EXCH_CODE") == 0)
exchCode = node.InnerXml;
else if (node.Name.CompareTo("SECURITY_DES") == 0 && assetType.ToUpper().CompareTo("OPTION") == 0)
desc = node.InnerXml;
//.........这里部分代码省略.........