天天看點

無法加載協定為“JavaWebService.UserInfoDelegate”的終結點配置部分,因為找到了該協定的多個終結點配置。請按名稱訓示首選的終結點配置部分。

原因是:

在vs 2008中使用C#,多次添加/删除服務引用後,app.config檔案并不會自動修改,

在添加/删除後,會生成多個“endpoint”,手工删除即可。

app.config中的内容:

  <client>

             <endpoint address="http://localhost:8080/WebService/UserInfoPort"

                 binding="basicHttpBinding" bindingConfiguration="WeatherWebServiceSoap"

                 contract="Weather.WeatherWebServiceSoap" name="WeatherWebServiceSoap" />

   </client>

   <client>

      <endpoint address="http://localhost:8080/WebService/UserInfoPort"

             <endpoint address="http://localhost:8080/WebService/UserInfoPort2"

   </client>