0
我使用visual studio 11添加服務(添加服務引用)。 當我加入該服務的文章,我有一個構造函數articleClient:綁定在客戶端+ WCF
public RssArticleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
如何使用這個構造函數,我不知道我的結合應該使用哪個值?
任何示例或示例?
的Merci
問候
我這樣做:
BasicHttpSecurityMode securitymode = BasicHttpSecurityMode.Transport; BasicHttpBinding binding = new BasicHttpBinding(securitymode); binding.MaxReceivedMessageSize = int.MaxValue; binding.MaxBufferSize = int.MaxValue; Uri uri = new Uri("adresse/RssArticleService.svc";); _clientArticles = new RssArticleServiceClient(binding, new EndpointAddress("adresse/RssArticleService.svc";)); var result=await _clientArticles.GetRssDataAsync("1", "fr");
和一導管此錯誤:
**here was no endpoint listening at adresse/RssArticleService.svc that could accept the message. This is often caused by an incorrect address or SOAP**
我能做些什麼,我應該改變綁定的類型?
BasicHttpSecurityMode SECURITYMODE = BasicHttpSecurityMode.Transport; BasicHttpBinding binding = new BasicHttpBinding(securitymode); binding.MaxReceivedMessageSize = int.MaxValue; binding.MaxBufferSize = int.MaxValue; Uri uri = new Uri(「https://adresse/RssArticleService.svc」); _clientArticles = new RssArticleServiceClient(binding,new EndpointAddress(「https://adresse/RssArticleService.svc」)); var result = await _clientArticles.GetRssDataAsync(「1」,「fr」); – user1428798