隔江千里
2019-07-19 10:37:52
找不到默認(rèn)的端點元素我向VS 2008/.NET 3.5解決方案中添加了一個Web服務(wù)代理。構(gòu)造客戶端.NET時會引發(fā)此錯誤:無法在ServiceModel客戶端配置部分找到引用契約“IMySOAPWebService”的默認(rèn)端點元素。這可能是因為沒有為您的應(yīng)用程序找到信任文件,或者因為在客戶端元素中找不到與此契約匹配的端點元素。搜索此錯誤會告訴我在契約中使用完整的命名空間。下面是帶有完整命名空間的app.config:<client>
<endpoint address="http://192.168.100.87:7001/soap/IMySOAPWebService"
binding="basicHttpBinding" bindingConfiguration="IMySOAPWebServicebinding"
contract="Fusion.DataExchange.Workflows.IMySOAPWebService" name="IMySOAPWebServicePort" /></client>我正在運行XPlocal(我提到這一點,因為很多Google點擊提到win2k3)app.config被復(fù)制到app.exe.config,所以這也不是問題。有什么線索嗎?
3 回答

千萬里不及你
TA貢獻(xiàn)1784條經(jīng)驗 獲得超9個贊

慕后森
TA貢獻(xiàn)1802條經(jīng)驗 獲得超5個贊
var remoteAddress = new System.ServiceModel.EndpointAddress(_webServiceUrl);using (var productService = new ProductClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress)){ //set timeout productService.Endpoint.Binding.SendTimeout = new TimeSpan(0,0,0,_webServiceTimeout); //call web service method productResponse = productService.GetProducts();}
編輯
BasicHttpsBinding
BasicHttpBinding
.

米琪卡哇伊
TA貢獻(xiàn)1998條經(jīng)驗 獲得超6個贊
合同=“IMySOAPWebService”
添加回答
舉報
0/150
提交
取消