【发布时间】:2012-05-23 08:10:06
【问题描述】:
我想知道用 VBA 调用 WCFService 的不同参数是什么?我发现了这个:
Dim addr As String
addr = "service:mexAddress=""net.http://y000zvk:7878/_vti_bin/Services/RetrieveList.svc/mex"","
addr = addr + "address=""net.http://y000zvk:7878/_vti_bin/Services/RetrieveList.svc/mex"","
addr = addr + "contract=""ServiceReference1.RetrieveList"", contractNamespace=""http://test.com"","
addr = addr + "binding=""basicHttpBinding"",bindingNamespace=""http://tempuri.org/"""
Dim service1 As Object
Set service1 = GetObject(addr)
MsgBox service1.GetSiteTitle()
但我真的不知道要在合同中pu,绑定,绑定命名空间参数。 我用 C# 创建了我的 WCF 服务,这是我的 app.config 端点:
<client>
<endpoint address="http://y000zvk:7878/_vti_bin/Services/RetrieveList.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_RetrieveList"
contract="ServiceReference1.RetrieveList" name="BasicHttpBinding_RetrieveList" />
</client>
您知道如何调用我的网络服务吗?有关我处于调试模式时的信息,我收到此错误:
无法初始化 MetadataExchangeClient 实例,因为方案“net.http”没有可用的绑定。您可以在构造函数中提供绑定,或指定配置名称。 参数名称:方案
提前致谢
【问题讨论】:
标签: c# wcf vba parameters endpoint