2016-04-03 15 views
0

SOAP APIに接続できるようにするASP .NET MVCアプリケーションがあります。契約を参照するデフォルトのエンドポイント要素が見つかりません

私はラッパープロジェクトを作成しました。これは、APIを使用している一般的なメソッドがあるからです。私はこのラッパーを作成しました。なぜなら、ツールで生成されたファイルは非常に巨大でプロジェクトのビルドには年月がかかるからです。 APIドキュメントサイトから :

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)

私は私のMVCアプリケーションに参照されている私のクラスライブラリ(中間層)でDLLとしてこのラッパーを参照しています。

悲しいことに、動作していない、と私はこのエラーを取得しています:

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

<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

エンドポイントは、あなたがスタート」の意味は何の.config、https://msdn.microsoft.com/en-us/library/09138bex(v=vs.90).aspx – Mate

+0

「プロジェクトを開始する」でなければなりませんプロジェクト "? –

+0

私のスタートアッププロジェクトのためにwebconfigに持っています –

答えて

0

私はコード内で手動でエンドポイントのセットアップとworkarroundを見つけるために管理しています。

EndpointAddress endpoint = new EndpointAddress("https://api.e-conomic.com/secure/api1/economicwebservice.asmx"); 
関連する問題