2016-04-03 32 views
0

SOAP API'ye bağlanmak için kullanabileceğim bir ASP .NET MVC uygulamasına sahibim.Sözleşmeyi referans gösteren varsayılan bitiş noktası öğesi bulunamadı

API ile çalışmakta olan yaygın yöntemlerim var, bir sarıcı proje oluşturdum. Bu sarmalayıcıyı oluşturdum, çünkü araç tarafından oluşturulan dosya, proje oluşturmanın yıllar alacağı kadar büyük. api doc sitesinden : Benim MVC uygulamasına başvurulmaktadır benim sınıf kitaplığında (orta katman) içinde dll bu sarmalayıcı başvurulan

The tool then generates a single file named EconomicWebService.cs with the proxy code. This file can then be included directly in a project (this can slow down your Visual Studio as it is a rather big file) or built into a dll that can be referenced from your project)

.

Ne yazık ki çalışmıyor ve bu hatayı alıyorum:

Could not find default endpoint element that references contract 'S2s.Economic.WebService.EconomicWebServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

webConfig ben kodda manuel bitiş noktası kurulumu ile bir workarround bulmayı başardık

<system.web> 
    ..... 
</system.web> 

<runtime> 
... 
</runtime> 

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="EconomicWebServiceSoap"> 
      <security mode="Transport" /> 
     </binding> 
     <binding name="EconomicWebServiceSoap1" /> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://api.e-conomic.com/secure/api1/economicwebservice.asmx" 
      binding="basicHttpBinding" bindingConfiguration="EconomicWebServiceSoap" 
      contract="PTS.S2s.Economic.WebService.EconomicWebServiceSoap" 
      name="EconomicWebServiceSoap" /> 
    </client> 
</system.serviceModel> 
</configuration> 
+0

uç nokta baştan" demek ne .Config, https://msdn.microsoft.com/en-us/library/09138bex(v=vs.90).aspx – Mate

+0

"proje başlatmak" olmalıdır proje "? –

+0

Evet, benim başlangıç ​​projesi –

cevap

0

.

EndpointAddress endpoint = new EndpointAddress("https://api.e-conomic.com/secure/api1/economicwebservice.asmx"); 
İlgili konular