talking to CRM from a Windows Service turns out to be problematic... RRS feed

  • Question

  • Hello,

    We have a Windows client application, starting an instance if a class, called "CommunicationHost", that is implemented in a windows library (dll file), and responsible for communicatng with Ms Dynamics CRM through the XRM sdk.  Calls to obtain data from CRM (through "IOrganizationService.RetrieveMultiple") and display the details in our client application works fine.

    Now we "replace" the client application by a Windows Service, starting exactly the same "CommunicationHost" class in the same DLL.  The authentication to Dynamics CRM goes fine.  However, exactly the same call to "IOrganizationService.RetrieveMultiple" results in a "System.ServiceModel.FaultException".

    We enabled "IncludeExceptionDetailInFaults " on the server, as the exception message suggested, but we do not obtain more information when re-producing the error.

    This is a part from our custom log file :

      <Event DateTime="2013-08-26T14:16:01" EventType="Exception">
        <ErrorMessage>The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug&gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</ErrorMessage>
    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&amp; 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&amp; msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple(QueryBase query)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultiple(QueryBase query)
       at CrmEntities.LonaloEntity.GetEntityId(String pKeyFieldName, String pKeyFieldValue)
       at CrmEntities.LonaloEntity.Find(String pKeyFieldName, String pKeyFieldValue)
       at CrmEntities.PointOfSales..ctor(IOrganizationService OrgService, String ShopId)
       at CrmCommunicationLibrary.EsbInboundMessageHandler.SendPosInformationResult(FindByShopId Message)</StackTrace>
    What could be the cause?

    Thx, Wim

    Monday, August 26, 2013 2:20 PM

All replies

  • Found the problem!

    Credentials must be used (appearantly) when authenticating to be able to launch actual db requests...

    Strange though, that this is not necessary for simply authenticating...

    Monday, August 26, 2013 2:51 PM