【发布时间】:2020-10-14 17:51:31
【问题描述】:
我正在 SSIS 脚本任务中创建 SSIS 包和编码。在我的代码中,我正在连接到第三方服务,但由于以下错误而无法连接
所以我检查了我的 app.config 文件并看到了蓝色波浪线,但我不知道它为什么在那里。这是我的 app.config 文件
我删除了合约并开始输入,我发现该服务没有在合约属性中列出。
这是我的代码文件
namespace ST_5fbd7f2f2bb84852b98e39162197f9df
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Text;
using LoginServiceReference;
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
// TODO: Add your code here
LoginServiceClient loginClient = null;
try
{
// Setup your user credentials.
string Message = "";
string AuthenticationToken = "";
string UserName = "";
string Password = "";
string UserAPIkey = "";
string CustomerAPIkey = "";
int TotalPages = 0;
// Create a proxy to the login service.
loginClient = new LoginServiceClient("WSHttpBinding_ILoginService");
// Submit the login request to authenticate the user.
AuthenticationStatus loginRequest = loginClient.Authenticate
(CustomerAPIkey, Password, UserAPIkey, UserName, out Message, out AuthenticationToken);
if (loginRequest == AuthenticationStatus.Ok)
{
MessageBox.Show("User authentication successful.");
}
else
{
MessageBox.Show("User authentication failed: " + Message.ToString());
}
Dts.TaskResult = (int)ScriptResults.Success;
}
catch (Exception ex)
{
MessageBox.Show("Exception: " + ex.ToString());
Dts.TaskResult = (int)ScriptResults.Failure;
} } }
}
如果您能在这方面提供帮助,我将不胜感激。
这是我所做的。
我尝试在关闭 VS 后删除 .SUO(解决方案用户选项)文件,这样它可以重置 XMLEditor 的 Cashe,但它不起作用。
这是我的版本:
Microsoft Visual Studio Professional 2015 版本 14.0.25431.01 更新 3
Microsoft .NET Framework 版本 4.7.02556
【问题讨论】:
标签: ssis