【发布时间】:2011-02-28 17:32:34
【问题描述】:
我有一个调用 WCF 服务的 SharePoint 工作流。只要工作流在 IIS 下运行并且没有转移到计时器服务,这工作正常。
问题在于 Timer Service 无权访问从 Timer Service 的上下文设置 WCF 连接所需的 web.config 设置。
Could not find endpoint element with name endpointname' and contract 'servicecontractname' in the ServiceModel client configuration section
我正在设置 WCF 在代码中建立连接所需的所有信息(并覆盖 web.config 中设置的值)
我的问题是,我可以完全绕过这个配置吗?我宁愿不依赖多个 etts 文件并保持它们同步。
更新 这段代码就成功了。
string address = "http://myservice.com/soap.svc";
Binding binding = new System.ServiceModel.BasicHttpBinding();
EndpointAddress endpointAddress = new EndpointAddress(address);
client = new MyServiceClient(binding, endpointAddress);
感谢您的意见!
【问题讨论】:
-
我在这里发布了使用 WSHttpBinding 的答案stackoverflow.com/questions/746107/…
标签: wcf sharepoint sharepoint-2007 config