2016-09-11 18 views
0

私はWCFサービスを持っており、開発ホストを使用するときはWCFテストクライアントで動作します。私はIIS 7を使用して、いくつかの方法を実行しようとするが、エラーがあります:WCFテストクライアントのエラーを取り除くには?

The underlying provider failed on Open. 

Server stack trace: 
    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) 
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at IDatabaseService.GetAllUsersWithRoles() 
    at DatabaseServiceClient.GetAllUsersWithRoles() 

サービスは、Entity Frameworkの上でMS SQL Serverと通信します。 IIS 7とMS SQL Serverは同じマシンに配置されます。

どのように動作させるには?

UPDATE - ここでは、web.configファイルの内容です:

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
     <compilation targetFramework="4.0" debug="true"> 
      <assemblies> 
       <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> 
      </assemblies> 
     </compilation> 
    </system.web> 
    <system.serviceModel> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior> 
        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
        <serviceMetadata httpGetEnabled="true"/> 
        <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
        <serviceDebug includeExceptionDetailInFaults="true"/> 
       </behavior> 
      </serviceBehaviors> 
     </behaviors> 
     <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
    <system.webServer> 
     <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
    <connectionStrings> 
     <add name="ForisTestLogsEntities" connectionString="metadata=res://*/ForisTestLogsModel.csdl|res://*/ForisTestLogsModel.ssdl|res://*/ForisTestLogsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=GORAN-PC\SQLEXPRESS;Initial Catalog=ForisTestLogs;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/> 
    </connectionStrings> 
</configuration> 
+0

を入力してください。 Web.configでサービスを構成しましたか?その場合は、要素を質問の一部として投稿してください。 –

+0

UPDATEを見てください。 – tesicg

答えて

0

あなたの設定ファイルは、任意のサービスまたはエンドポイントを定義していません。これを行う方法については、MSDNの次のページを参照してください。Configuring Services

<services><bindings>要素をWeb.configファイルに追加する必要があります。 Simplified Configuration

手動設定エディタツールを使用してみてください、あなたのWeb.configファイルを編集するような気がしない場合:あなたは、.NET Framework 4.0で導入された構成を簡略化して試すことができます別の方法として

。 Web.configファイルを右クリックし、コンテキストメニューから "Edit WCF Configuration"を選択するだけです。ツールの詳細については、 here

関連する問題