0

错误信息是:

在 ServiceModel 客户端配置部分中找不到名为“NetbiterServiceReference.nbws”和合同“NetbiterServiceReference.nbws”的端点元素。

我的app.config文件如下所示:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="nbws.cfcSoapBinding">
                <security mode="Transport" />
            </binding>
            <binding name="nbws.cfcSoapBinding1" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://../nbws.cfc"
            binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
            contract="NetbiterServiceReference.nbws" name="nbws.cfc" />
    </client>
</system.serviceModel>

在我的代码中,我确实喜欢这样,并且给出了上面的错误消息。

 nbwsClient proxy = new nbwsClient();

然后我做了所有这些组合,但结果相同:

nbwsClient proxy = new nbwsClient("NetbiterServiceReference.nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws.cfc", "https://../nbws.cfc");

任何想法,将不胜感激!

4

2 回答 2

0

错误消息是:在 ServiceModel 客户端配置部分中找不到名为“NetbiterServiceReference.nbws”和合同“NetbiterServiceReference.nbws”的端点元素。我的 app.config 文件如下所示:


如果您按如下方式更改端点部分,您将丢失此错误。

<endpoint address="https://../nbws.cfc" 
            binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding" 
            contract="NetbiterServiceReference.nbws" name="NetbiterServiceReference.nbws" /> 
于 2012-05-17T14:02:43.463 回答
0

自己解决了。问题是测试项目,使用代码和 app.config 运行项目在 app.config 中没有正确的信息。

于 2012-05-20T08:26:16.190 回答