【问题标题】:What are the parameters for a web service in vbavba中Web服务的参数是什么
【发布时间】: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


    【解决方案1】:

    而不是 net.http -> 使用 http

    我假设你已经编辑了一个 net.tcp:// 地址并且只替换了一半的方案?

    【讨论】:

    • 嘿,谢谢你的帮助,是的,就是这样:)。无论如何,我正在使用另一种解决方案来解决我的问题,但谢谢;)
    猜你喜欢
    • 2012-01-19
    • 2014-06-17
    • 2010-11-17
    • 2012-04-06
    • 2010-11-03
    • 1970-01-01
    • 2011-03-13
    • 2011-04-07
    • 1970-01-01
    相关资源
    最近更新 更多