簡體   English   中英

找不到引用合同的默認端點元素

[英]Could not find default endpoint element that references contract

我的是Windows應用程序。 我正在使用Web服務。 當我向我的應用程序添加服務引用時,將生成一個app.config文件。

<client>
    <endpoint address="http://58.71.131.223/uucpapi/UUCPAPIServer.svc"
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUUCPAPIServer"
        contract="UUCPAPI.IUUCPAPIServer" name="WSHttpBinding_IUUCPAPIServer">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint>
</client>

我正在將此API稱為

UUCPAPI.UUCPAPIServerClient uucp = new UUCPAPI.UUCPAPIServerClient();

在這里它拋出異常

ServiceModel客戶端配置部分中找不到引用合同'UUCPAPI.IUUCPAPIServer'的默認終結點元素。 這可能是因為找不到您的應用程序的配置文件,或者是因為在客戶端元素中找不到與該協定匹配的端點元素。”

<client>
    <endpoint address="http://...../uucpapi/UUCPAPIServer.svc" 
              binding="wsHttpBinding" 
              binding configuration="WSHttpBinding_IUUCPAPIServer" 
              contract="UUCPAPI.IUUCPAPIServer" 
              name="WSHttpBinding_IUUCPAPIServer">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint> 
</client>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM