クラスライブラリへの参照を使用するWCFサービスがあります。そのライブラリのクラスは、データベースとの対話などを行います。ブラウザを介したRESTful呼び出しを使用してサービス(エラーなしでコンパイル)をテストしていましたが、「エンドポイントが見つかりません」というページが表示されるだけです。これは、ライブラリに接続文字列やアプリ設定などへの参照があるという事実に関連していると思います(通常、このライブラリを使用するアプリケーションに含める必要があります)。したがって、私が見つけるのに苦労しているのは、このライブラリで動作するようにwcfサービスを適切に構成する方法です。接続文字列とアプリセットをwcfweb.configに追加しようとしましたが、役に立たないようです。サービスのエンドポイントセクションからライブラリへの参照を追加するだけのように感じます。しかし、私はそこで迷子になっています。どんな助けでも大歓迎です。ありがとう
<system.serviceModel>
<services>
<service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name ="ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
更新:トレースを実行すると、これはスローされた例外からのスタックトレースです:
System.ServiceModel.Dispatcher.HttpUnhandledOperationInvoker.Invoke(Object instance、Object [] input、Object []&outputs)System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&rpc) System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&rpc)System.ServiceModel.Dispatcher。 rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime。ProcessMessage11(MessageRpc&rpc)System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&rpc)System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperation System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk。 UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueueServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&rpc)System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler .HandleRequest(RequestContext request、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System。 Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueueServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&rpc)System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler .HandleRequest(RequestContext request、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System。 Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueuerpc)System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request、OperationContext currentOperationContext) System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously) System.Runtime.InputQueuerpc)System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request、OperationContext currentOperationContext) System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously) System.Runtime.InputQueueDispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete( IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueueDispatchAndReleasePump(RequestContext request、Boolean cleanThread、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request、OperationContext currentOperationContext)System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete( IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueueAsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueueAsyncMessagePump(IAsyncResult result)System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)System.Runtime.AsyncResult.Complete(Boolean completeSynchronously)System.Runtime.InputQueue1.AsyncQueueReader.Set(Item item)
System.Runtime.InputQueue
1.EnqueueAndDispatch(Item item、Boolean canDispatchOnThisThread)System.Runtime.InputQueue1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
System.ServiceModel.Channels.SingletonChannelAcceptor
3.Enqueue(QueueItemType item、Action dequeuedCallback、Boolean canDispatchOnThisThread)System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context、Action callback)System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)System.ServiceModel.Activation.HostedHttpRequestAsyncResult。 HandleRequest()System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode、UInt32 numBytes、NativeOverlapped * nativeOverlapped) .Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32エラー、UInt32 bytesRead、NativeOverlapped * nativeOverlapped)System.Threading._IOCompletionCallback。PerformIOCompletionCallback(UInt32 errorCode、UInt32 numBytes、NativeOverlapped * pOVERLAP)