I am creating two applications one is console app which will be send messages to the client machines(MSMQ). And another one MSMQ with WCF service which resides in all the client machines and reads all the messages from Private queue. My console application working fine means it is sending messages to client machines. But WCF service does not picking up the messages from queue automatically. Please help me in resolving this issue.
It would be a great help.
I). Following is my Interface:
namespace MessageReceiver
{
[ServiceContract]
[ServiceKnownType(typeof(MessageContainer))]
public interface IMessageHandlerService
{
[OperationContract(IsOneWay = true, Action = "*")]
void ProcessIncomingMessage(MsmqMessage<MessageContainer> incomingOrderMessage);
}
}
II). Following is my implementation class
public class MessageHandlerService : IMessageHandlerService
{
#region IMessageHandlerService Members
[OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
public void ProcessIncomingMessage(MsmqMessage<MessageContainer> incomingOrderMessage)
{
}
#endregion
}
III). Following is my contracts
namespace MessageReceiver
{
[DataContract]
public class MessageContainer
{
public MessageContainer()
{
}
[DataMember(IsRequired = true)]
public string ProcessName { get; set; }
[DataMember(IsRequired = true)]
public string RoboName { get; set; }
public MessageToRobo msg { get; set; }
}
public class MessageToRobo
{
[DataMember(IsRequired = true)]
public string Value1 { get; set; }
[DataMember(IsRequired = true)]
public string Value2 { get; set; }
[DataMember(IsRequired = true)]
public string Value3 { get; set; }
}
}
IV). Following is my web.config
="1.0"
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="IncludeExceptionDetails">
<callbackDebug includeExceptionDetailInFaults="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MessageReceiver.MessageHandlerService">
<endpoint address="msmq.formatname:DIRECT=OS:MachineName\private$\MessageForRobo" binding="msmqIntegrationBinding" bindingConfiguration="IncomingMessageHandlerBinding" contract="MessageReceiver.IMessageHandlerService">
</endpoint>
</service>
</services>
<bindings>
<msmqIntegrationBinding>
<binding name="IncomingMessageHandlerBinding"
closeTimeout="00:30:00"
receiveTimeout="01:00:00"
retryCycleDelay="00:00:10"
receiveRetryCount="0"
exactlyOnce="true"
maxRetryCycles="3"
receiveErrorHandling="Move">
<security mode="None"/>
</binding>
</msmqIntegrationBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing, All" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\logs\DNCTrace.svclog"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>