错误信息是:
找不到名称的端点元素 'NetbiterServiceReference.nbws'和合同 ServiceModel客户端中的“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");
任何想法都将不胜感激!
答案 0 :(得分:0)
错误消息是:找不到名称为“NetbiterServiceReference.nbws”的端点元素,并在ServiceModel客户端配置部分中收缩“NetbiterServiceReference.nbws”。我的app.config文件如下所示:
如果您按如下方式更改端点部分,则会丢失此错误。
<endpoint address="https://../nbws.cfc"
binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
contract="NetbiterServiceReference.nbws" name="NetbiterServiceReference.nbws" />
答案 1 :(得分:0)
我自己解决了。 问题是,使用代码和app.config运行项目的测试项目在app.config中没有正确的信息。