WCF VSTO客户端无法找到默认的端点win2k8部署时, [英] WCF VSTO client cannot find default endpoint when deployed on win2k8

查看:88
本文介绍了WCF VSTO客户端无法找到默认的端点win2k8部署时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建和Win2008R2终端服务器上部署WCF客户端(从VSTO Word中加载项启动)。 当excution的WCF代理的默认构造函数的 InvalidOperationException异常被抛出,说明为合同默认的端点无法找到。

I created and deployed a WCF client (launched from a VSTO Word Addin) on a Win2008R2 Terminal Server. When excution the default constructor of the WCF proxy an InvalidOperationException is thrown, stating that the default endpoint for the contract cannot be found.

在部署到Win7的X64机器同样WCF客户端只使用相同的.dll.config运行正常

The same WCF client when deployed to a Win7 x64 machine just runs fine using the same .dll.config

我试图创建内部PowerShell的一个实例,并收到同样的错误。

I tried to create an instance inside PowerShell and receive the same error.

如果在PowerShell中创建一个端点奉献我可以EXCUTE服务方式:

If creating a dedicate endpoint in PowerShell I can excute a service method:

$binding = New-Object System.ServiceModel.BasicHttpBinding
$endpoint = New-Object System.ServiceModel.EndPointAddress("http://myserver:7777/CompanyService.svc")
$client = New-Object MyClient.CompanyServiceReference.CompanyServiceClient($binding, $endpoint)
$v = $client.Version()

服务的Web.config(部分)

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <basicHttpBinding>
            <binding name="NoHttpSecurity" sendTimeout="00:03:00">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <services>
        <service name="CompanyService">
            <endpoint address="http://myserver:7777/mex" contract="IMetadataExchange" binding="mexHttpBinding" />
            <endpoint name="Version" address="http://myserver:7777/Version" contract="MyService.ICompanyService" binding="basicHttpBinding" bindingConfiguration="NoHttpSecurity" />
            <endpoint name="CompanyList" address="http://myserver:7777/CompanyList" contract="MyService.ICompanyService" binding="basicHttpBinding" bindingConfiguration="NoHttpSecurity" />
        </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

MyClient.dll.config(部分)

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ICompanyService" closeTimeout="00:01:00">
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://myserver:7777/CompanyService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICompanyService"
         contract="CompanyServiceReference.ICompanyService" name="BasicHttpBinding_ICompanyService" />
    </client>
</system.serviceModel>


更新

我固定这个复制我Client.config到Office程序文件夹,并将其重命名为WINWORD.EXE.config。

I "fixed" this by copying my Client.config to the Office Program Folder and renaming it to WINWORD.EXE.config.

推荐答案

可以编程方式创建一个终结点?

Can you create an endpoint programmatically?

MyProxy proxy = new MyProxy (new BasicHttpBinding(), new EndpointAddress("http://server/Service.svc"));

如果工作正常,那么很可能它的的配置问题。

If this works, then very probably it is a configuration issue.

这篇关于WCF VSTO客户端无法找到默认的端点win2k8部署时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆