Wcf 使用WF通过HTTPS调用Soap服务
我已经针对Postman测试了端点,尽管VisualStudio声称它确实存在。当我添加服务引用时,app.config文件中出现错误,因此我决定在代码中手动配置绑定和端点 脚本任务:Wcf 使用WF通过HTTPS调用Soap服务,wcf,ssis,soap-client,Wcf,Ssis,Soap Client,我已经针对Postman测试了端点,尽管VisualStudio声称它确实存在。当我添加服务引用时,app.config文件中出现错误,因此我决定在代码中手动配置绑定和端点 脚本任务: public void Main() { //configure WCF manually , endpoint, HTTPS binding, etc BasicHttpsBinding binding = new System.ServiceModel.BasicHt
public void Main()
{
//configure WCF manually , endpoint, HTTPS binding, etc
BasicHttpsBinding binding = new System.ServiceModel.BasicHttpsBinding(BasicHttpsSecurityMode.Transport);
EndpointAddress address = new EndpointAddress("https://service/services/Operation.svc");
ST_364d1c14d92b406e87f51c75a462f403.ClientServiceRef.ClientService1Client client = new ClientService1Client(binding, address);
client.ClientCredentials.UserName.UserName = "";
client.ClientCredentials.UserName.Password = "";
//make call to SOAP service using client instance
var column_names = client.GetAllClients();
Dts.TaskResult = (int)ScriptResults.Success;
}
运行时错误-似乎无法识别端点
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
以下是app.config文件供参考
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IClientService1">
<security mode="Transport" />
</binding>
<binding name="BasicHttpBinding_IClientService11" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https:/server.com/services/ClientService1.svc/soap"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IClientService1"
contract="ClientServiceRef.IClientService1" name="BasicHttpBinding_IClientService1" />
</client>
</system.serviceModel>
</configuration>
有关更多信息,请参阅我的相关问题,它是否会在执行client.getAllClient()时引发该异常代码>或当它执行时Dts.TaskResult=(int)ScriptResults.Success代码>?该错误看起来与找不到终结点无关。@Popo当它找到client.GetAllClients()时-SSIS中似乎也有一个错误,对脚本组件的更改没有被保存。您是否对调用client.GetAllClients()时服务执行的代码有详细说明代码>包装在try-catch块中?该错误看起来确实是SSIS脚本任务的错误,而不是web服务调用的错误。也许我错过了一些东西。