RavenTimeoutPersistence error when starting NserviceBus.host - nservicebus

When I try & start one of my services I get this error:
There is no index named: RavenTimeoutPersistence/TimeoutDataSortedByTime
Stacktrace:
Unhandled Exception: Magnum.StateMachine.StateMachineException:
Exception occurred in Topshelf.Internal.ServiceControlle
r1[[NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host,
Version=3.2.0.0, Culture=neutral, PublicKeyToken=9fc3864 79f8a226c]]
during state Initial while handling OnStart ---> System.Exception:
Exception when starting endpoint, error h as been logged. Reason:
There is no index named: RavenTimeoutPersistence/TimeoutDataSortedByTime --->
System.InvalidOper ationException: There is no index named:
RavenTimeoutPersistence/TimeoutDataSortedByTime at
Raven.Client.Connection.ServerClient.DirectQuery(String index,
IndexQuery query, String operationUrl, String[] inc ludes) at
Raven.Client.Connection.ServerClient.<>c__DisplayClass37.<Query>b__36(String
u) at Raven.Client.Connection.ServerClient.TryOperation[T](Func2
operation, String operationUrl, Boolean avoidThrowing, T& result)
at
Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String
method, Func2 operation) at
Raven.Client.Connection.ServerClient.Query(String index, IndexQuery
query, String[] includes) at
Raven.Client.Document.AbstractDocumentQuery2.ExecuteActualQuery()
at Raven.Client.Document.AbstractDocumentQuery2.get_QueryResult()
at
Raven.Client.Linq.RavenQueryProviderProcessor1.ExecuteQueryTProjection
at Raven.Client.Linq.RavenQueryProviderProcessor1.Execute(Expression
expression) at
Raven.Client.Linq.RavenQueryProvider1.Execute(Expression expression)
at
Raven.Client.Linq.RavenQueryProvider1.System.Linq.IQueryProvider.Execute(Expression
expression) at
Raven.Client.Linq.RavenQueryInspector1.GetEnumerator() at
System.Collections.Generic.List1.InsertRange(Int32 index,
IEnumerable1 collection) at
NServiceBus.Timeout.Hosting.Windows.Persistence.RavenTimeoutPersistence.GetAll()
at NServiceBus.Timeout.Core.TimeoutRunner.CacheExistingTimeouts()
at NServiceBus.Timeout.Core.TimeoutRunner.Run() at
System.Collections.Generic.List1.ForEach(Action1 action) at
NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start(Action
startupAction) at NServiceBus.Hosting.GenericHost.Start() in
c:\TeamCity\buildAgent\work\nsb.master_6\src\hosting\NServiceBus.Hostin
g\GenericHost.cs:line 34
Configuration of the host is:
var container = new WindsorContainer();
container.Install(FromAssembly.This());
Configure.With()
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("Events"))
.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("Messages"))
.CastleWindsorBuilder(container)
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.IsolationLevel(IsolationLevel.ReadUncommitted)
.UnicastBus()
.RavenSagaPersister()
.RavenSubscriptionStorage()
.UseRavenTimeoutPersister()
.RunTimeoutManager()
.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install();
I have other services on this machine that are running without error. I've tried restarting the ravendb service.
Running Nservicebus 3.2.5

You are missing an index: RavenTimeoutPersistence/TimeoutDataSortedByTime
You need to create it, or NSB needs to create it, I am not sure where this index came from.

Related

Value cannot be null exception when trying to run Imageresizer

I get the following error when trying to run my Image Resizer using my rest api plugin with this urL: http://localhost:8001/D1900010012059
Plugin code can be found here: https://github.com/mikaelekstrom/resizerapiplugin/blob/master/RestAPIImageRetriever.cs
Value cannot be null.
Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: value
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: value]
System.String.StartsWith(String value, StringComparison comparisonType) +598
ImageResizer.Storage.BlobProviderBase.FileExists(String virtualPath, NameValueCollection queryString) +88
ImageResizer.Plugins.VirtualPathProviderShim.GetVIP(String virtualPath) +217
ImageResizer.Plugins.VirtualPathProviderShim.FileExists(String virtualPath) +23
System.Web.Routing.RouteCollection.IsRouteToExistingFile(HttpContextBase httpContext) +120
System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +129
System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +70
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88
You need to set the VirtualFilesystemPrefix property on the base class to set up routing for your class. You class will handle all requests going to that prefix.

SID of the target principal could not be resolved.

I delpoyed my web application (which uses LDAP) on windows server 2016. It is throwing below error. Though I am able to access same ADLDS instance using ADSI or C# console application (created utility to test connectivity). But not sure why its throwing error with web application. Please suggest.
Server Error in '/' Application.
**While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.**
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.DirectoryServices.AccountManagement.PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.]
System.DirectoryServices.AccountManagement.ADStoreCtx.ResolveCrossStoreRefToPrincipal(Object o) +570
System.DirectoryServices.AccountManagement.ADUtils.DirectoryEntryAsPrincipal(DirectoryEntry de, ADStoreCtx storeCtx) +133
System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.get_CurrentAsPrincipal() +86
System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.MoveNext() +252
System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.System.Collections.IEnumerator.MoveNext() +9
System.Linq.<SelectManyIterator>d__22`3.MoveNext() +65
System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +264
System.Linq.GroupedEnumerable`3.GetEnumerator() +72
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +63
System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) +392
System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) +15
Plastin.Common.Security.ADLDSClaimsProvider.SetApplicationClaims() +1012
Plastin.Common.Security.ADLDSClaimsProvider.Initialise() +174
Plastin.Common.Security.ADLDSClaimsProvider..cctor() +238
[TypeInitializationException: The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.]
lambda_method(Closure , IBuilderContext ) +81
Microsoft.Practices.ObjectBuilder2.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context) +35
Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) +10
Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +198
Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +209
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +165
[ResolutionFailedException: Resolution of the dependency failed, type = "Plastin.Common.Security.IClaimsProvider", name = "(none)".
Exception occurred while: Calling constructor Plastin.Common.Security.ADLDSClaimsProvider().
Exception is: TypeInitializationException - The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.
-----------------------------------------------
At the time of the exception, the container was:
Resolving Plastin.Common.Security.ADLDSClaimsProvider,(none) (mapped from Plastin.Common.Security.IClaimsProvider, (none))
Calling constructor Plastin.Common.Security.ADLDSClaimsProvider()
]
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +329
Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) +15
Microsoft.Practices.Unity.UnityContainerExtensions.Resolve(IUnityContainer container, ResolverOverride[] overrides) +72
Plastin.Common.Security.AuthenticationManager.Authenticate(String resourceName, ClaimsPrincipal incomingPrincipal) +149
Plastin.Portal.MvcApplication.Application_PostAuthenticateRequest() +70
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +87
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +21
System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +56
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
Finally we fixed this issue and my apologies I am getting late to answer this question. After lots of debugging we identified that our web application was throwing this error while getting members of ADLDS group. It was unusual as same application was working on other server. So we decided to captured network traffic using Wireshark. Wireshark capture indicated that connectivity between LDAP server and application server was blocked over SMB port 445. So we get our Network team to open port 445 which fixed the issue.
This error seems very generic error and could be other reasons for this error in your scenario but using network traffic capturing tool (like wireshark) at early stage of investigation might help you to troubleshoot these kind of issue quickly.

RavenDB Errors with NServiceBus 4.0

I've downloaded and installed NServiceBus 4.0, but I'm having some difficulty when the bus starts up...
2013-09-18 15:53:40,887 [1] WARN NServiceBus.Persistence.Raven.RavenUserInstall
er [(null)] <(null)> - Failed to add user to raven. Processing will continue
System.MissingMethodException: Method not found: 'Raven.Abstractions.Data.PutRes
ult Raven.Client.Connection.IDatabaseCommands.Put(System.String, System.Nullable
`1, Raven.Json.Linq.RavenJObject, Raven.Json.Linq.RavenJObject)'.
at NServiceBus.Persistence.Raven.RavenUserInstaller.AddUserToDatabase(String
identity, DocumentStore documentStore)
at NServiceBus.Persistence.Raven.RavenUserInstaller.Install(String identity)
in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Persistence\Raven\Ra
venUserInstaller.cs:line 40
also when I try to persist changes to the document store...
public class RavenUnitOfWork: IManageUnitsOfWork
{
public IDocumentSession Session { get; set; }
public void Begin()
{
}
public void End(Exception ex = null)
{
if (ex == null && Session != null)
{
Console.WriteLine("Saving Changes to DB.");
Session.SaveChanges();
}
}
}
produces
2013-09-18 15:57:38,007 [13] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xx
xx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failure
MessageID, Object failureMessageFormatArgument, String failureArgumentName, Exce
ption innerException)
at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result)
at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
at System.Guid..ctor(String g)
at Raven.Database.Server.AbstractRequestResponder.GetRequestTransaction(IHttp
Context context)
at Raven.Database.Server.Responders.DocumentBatch.Respond(IHttpContext contex
t)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)
---> System.Net.WebException: The remote server returned an error: (500) Intern
al Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getRespons
e) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonReque
st.cs:line 340
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unica
st\Transport\TransportReceiver.cs:line 357
at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessag
e message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\T
ransport\TransportReceiver.cs:line 235
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Trans
ports\Msmq\MsmqDequeueStrategy.cs:line 262
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in c:\BuildAgent\
work\d4de8921a0aabf04\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.c
s:line 197
2013-09-18 15:57:38,129 [29] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xx
xx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failure
MessageID, Object failureMessageFormatArgument, String failureArgumentName, Exce
ption innerException)
at System.Guid.TryParseGuidWithDashes(String guidString, GuidResult& result)
at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
at System.Guid..ctor(String g)
at Raven.Database.Server.AbstractRequestResponder.GetRequestTransaction(IHttp
Context context)
at Raven.Database.Server.Responders.DocumentBatch.Respond(IHttpContext contex
t)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)
---> System.Net.WebException: The remote server returned an error: (500) Intern
al Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getRespons
e) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonReque
st.cs:line 340
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unica
st\Transport\TransportReceiver.cs:line 357
at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessag
e message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Unicast\T
ransport\TransportReceiver.cs:line 235
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.ProcessMessage(TransportMe
ssage message) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Trans
ports\Msmq\MsmqDequeueStrategy.cs:line 262
at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in c:\BuildAgent\
work\d4de8921a0aabf04\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.c
s:line 197
2013-09-18 15:57:38,262 [30] INFO NServiceBus.Unicast.Transport.TransportReceiv
er [(null)] <(null)> - Failed to process message
System.InvalidOperationException: Url: "/bulk_docs"
I've configured Raven as follows:
Configure.Instance.Configurer.ConfigureComponent<IDocumentStore>(() =>
{
var store = new DocumentStore
{
Url = "" // <-- Points to my machine at port 8080
};
store.Initialize();
store.JsonRequestFactory.DisableRequestCompression = true;
return store;
}, DependencyLifecycle.SingleInstance);
Configure.Instance.Configurer.ConfigureComponent<IDocumentSession>(() => { return Configure.Instance.Builder.Build<IDocumentStore>().OpenSession(); }, DependencyLifecycle.InstancePerUnitOfWork);
Configure.Instance.Configurer.ConfigureComponent<RavenUnitOfWork>(DependencyLifecycle.InstancePerUnitOfWork);
What am I missing here?
Thanks.
It's a known issue. See #1518. It's been fixed in #1551, but hasn't yet made it into a release. Either try building yourself from source, or wait for it to be included in a release.
Please make sure you are running Raven v2.
Raven v2.5 has not been tested against NServiceBus v4!
I fixed the MissingMethodException I was getting when using Raven Client 2.5 and NServiceBus 4.4.2 by adding an assembly binding redirect
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Raven.Client.Lightweight" publicKeyToken="37f41c7f99471593" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

Self-hosted WCF 4.5 WsHttpBinding -> 400 Bad Response

I'm self-hosting a WCF WSHttpBinding bound service. When running, I can't get any variation on the service call to work. Can you diagnose this problem?
A basic GET from the address bar (multiple browsers) fails with 400 Bad Request. So does $.ajax with GET, POST with 'dataType': 'json' or 'dataType': 'jsonp'. I've tried variations on the base address. Including or omitting the WebInvokeAttribute doesn't make a difference. Whether or not the HTTP Method is matched or mismatched doesn't make a difference.
Setting the service endpoint to a narrower path and then browsing to paths outside of that endpoint appropriately results in an error (about the method not being allowed). Using GET from ajax without jsonp will fail due to cross-site-scripting protections as expected but I can avoid that scenario.
(There are a million versions of this question online. Some seem resolved, but with answers that don't help. Others are unresolved. This is not an exact duplicate of any of them.)
The WCF trace invariably indicates: "There is a problem with the XML that was received from the network." with "The body of the message cannot be read because it is empty" as the inner exception - even for a GET request for which there should be no body (right?). Even if I attempt to POST with json data of '' or '{}', I get still this error exactly.
This code sample is mostly from: http://msdn.microsoft.com/en-us/library/ms730935.aspx, a .Net 4.5 WCF sample. The sample is bigger than necessary and I had to add binding.HostNameComparisonMode = HostNameComparisonMode.Exact; so that Windows would allow it to run without full admin rights. I also played with the relative url (now empty) to test.
Running this and pointing the browser to http://localhost:8000/ is properly serving the MEX/WSDL advertisement. This tells me that the webservice is running and that I am browsing to the right endpoint (plus or minus a service prefix, at least) and that Windows Firewall or permissions are not interfering with the process's ability to open or serve on a port. Yet http://localhost:8000/Ping just gets 400.
If I remember correctly (maybe not though), older versions of WCF and .NET didn't allow or didn't support self-hosted web-like protocols. I believe that's changed. Again, the serving of the MEX data isn't all that different from the custom stuff I want to serve - it's just coming from a different place in the same process.
sdb.IncludeExceptionDetailInFaults = true; seems to have no helpful effect here.
using System;
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Web;
namespace WCFWebHost
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
Uri baseAddress = new Uri("http://localhost:8000/");
ServiceHost selfHost = new ServiceHost(typeof(EchoService), baseAddress);
try
{
var binding = new WSHttpBinding();
binding.HostNameComparisonMode = HostNameComparisonMode.Exact;
selfHost.AddServiceEndpoint(typeof(IEcho), binding, "");
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb);
var sdb = selfHost.Description.Behaviors.Find<ServiceDebugBehavior>();
sdb.IncludeExceptionDetailInFaults = true;
selfHost.Open();
Console.WriteLine("Open and waiting.");
Console.ReadKey(true);
selfHost.Close();
}
catch (CommunicationException ce)
{
Console.WriteLine("An exception occurred: {0}", ce.Message);
selfHost.Abort();
}
}
}
[ServiceContract(Namespace = "http://echo")]
public interface IEcho
{
[OperationContract]
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest,
UriTemplate = "Ping")]
void Ping();
}
public class EchoService : IEcho
{
public void Ping()
{
}
}
}
The web config has this traces.svc configuration added:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel"
switchValue="Verbose, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\Users\...\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
===
Something that seems odd to me is that the traced exception seems to be coming from the error reporting itself. Is this error in the trace hiding better information about the original failure? Or am I just reading a re-throw wrong?
<Exception>
<ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>There is a problem with the XML that was received from the network. See inner exception for more details.</Message>
<StackTrace>
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.ExceptionToTraceString(Exception exception, Int32 maxTraceStringLength)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetSerializedPayload(Object source, TraceRecord traceRecord, Exception exception, Boolean getServiceReference)
at System.Runtime.TraceCore.ThrowingException(EtwDiagnosticTrace trace, String param0, String param1, Exception exception)
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception, String eventSource)
at System.Runtime.ExceptionTrace.AsError(Exception exception)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult..ctor(ReplyChannelAcceptor acceptor, Action dequeuedCallback, HttpPipeline pipeline, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.SharedHttpTransportManager.EnqueueContext(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContext(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.ListenerAsyncResult.IOCompleted(ListenerAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>System.ServiceModel.ProtocolException: There is a problem with the XML that was received from the network. See inner exception for more details. ---> System.Xml.XmlException: The body of the message cannot be read because it is empty.
--- End of inner exception stack trace ---</ExceptionString>
<InnerException>
<Exception>
<ExceptionType>System.Xml.XmlException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The body of the message cannot be read because it is empty.</Message>
<StackTrace>
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetInnerException(Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.ExceptionToTraceString(Exception exception, Int32 maxTraceStringLength)
at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetSerializedPayload(Object source, TraceRecord traceRecord, Exception exception, Boolean getServiceReference)
at System.Runtime.TraceCore.ThrowingException(EtwDiagnosticTrace trace, String param0, String param1, Exception exception)
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception, String eventSource)
at System.Runtime.ExceptionTrace.AsError(Exception exception)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult..ctor(ReplyChannelAcceptor acceptor, Action dequeuedCallback, HttpPipeline pipeline, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.SharedHttpTransportManager.EnqueueContext(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContext(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.ListenerAsyncResult.IOCompleted(ListenerAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
<ExceptionString>System.Xml.XmlException: The body of the message cannot be read because it is empty.</ExceptionString>
</Exception>
</InnerException>
</Exception>
WSHttpBinding creates a soap based binding. You cannot access this endpoint using a browser by navigating to the URL. You can access this binding by creating a service proxy or using wcftestclient (for testing). If you are looking for developing a REST endpoint then use webHttpBinding instead of wsHttpBinding.
Here is a quick sample on how to develop REST based service. Here is a post which describes the differences between webHttpBinding & wsHttpBinding.
Call WCF Service exposed with WSHttp binding
web.config Settings
<services>
<service name="MyWcfService.MyService">
<endpoint address="jh" binding="wsHttpBinding" bindingConfiguration="NoSecurity" contract="MyWcfService.IMyService" />
</service>
</services>
html page
//SOAP request generated in order to call the Service method
var whRequest ="<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">" +
"<s:Header>" +
"<a:Action s:mustUnderstand=\"1\">http://tempuri.org/IMyService/GetData</a:Action>" +
"<a:MessageID>urn:uuid:7fdde7b6-64c8-4402-9af1-cc848f15888f</a:MessageID>" +
"<a:ReplyTo>" +
"<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>" +
"</a:ReplyTo>" +
"<a:To s:mustUnderstand=\"1\">http://localhost:1415/MyService.svc/jh</a:To>" +
"</s:Header>" +
"<s:Body>" +
"<GetData xmlns=\"http://tempuri.org/\">"+
"<value>9</value>"+
"</GetData>" +
"</s:Body>" +
"</s:Envelope>";
$(document).ready(function () {
$("#btnWCFWSHttp").click(function () {
$.ajax({
type: "POST",
url: "http://localhost:1415/MyService.svc/jh/",
data: whRequest,
timeout: 10000,
contentType: "application/soap+xml",
dataType: "xml",
async: false,
success: function (data, status, xhr) {
$(data).find("GetDataResponse").each(function () {
alert($(this).find("GetDataResult").text());
});
},
error: function (xhr, status, error) {
alert(error);
}
});
});
});

WCF Application "Unable to find assembly" for SQLite

Note: This is a solved problem, but I just spend 4 hours at this issue, so I wanted to share the solution.
When I attempt to access a WCF service, the service never responds, and the event log shows the following:
An unhandled exception occurred and
the process was terminated.
Application ID: DefaultDomain
Process ID: 3180
Exception:
System.Runtime.Serialization.SerializationException
Message: Unable to find assembly
'System.Data.SQLite, Version=1.0.66.0,
Culture=neutral,
PublicKeyToken=db937bc2d44ff139'.
StackTrace: at
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo
assemblyInfo, String name) at
System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String
objectName, String[] memberNames,
BinaryTypeEnum[] binaryTypeEnumA,
Object[] typeInformationA, Int32[]
memberAssemIds, ObjectReader
objectReader, Int32 objectId,
BinaryAssemblyInfo assemblyInfo,
SizedArray assemIdToAssemblyTable)
at
System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped
record) at
System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum
binaryHeaderEnum) at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser,
Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage
methodCallMessage) at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler
handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage
methodCallMessage) at
System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream
stm) at
System.AppDomain.Deserialize(Byte[]
blob) at
System.AppDomain.UnmarshalObject(Byte[]
blob)
Solution
In my case, the problem ended up being a simple incorrect database path. However, the error message in no way reflects the actual cause, so YMMV.
The reason the "bad connection string" exception didn't make it to the event log seems related to this KB article. If the connection string isn't your problem, then your best course may be to follow the steps in this article, which will cause IIS to write exceptions to the event log.