Click here to Skip to main content
15,944,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a simple WCF application to learn about MSMQ.
i just want any text to be stored in MSMQ when client application runs.

Clientwebconfig--

XML
<configuration>
    <system.servicemodel>
        <bindings>
            <basichttpbinding>
                <binding name="BasicHttpBinding_IHello" closetimeout="00:01:00">
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientcredentialtype="None" proxycredentialtype="None">
                            realm="" />
                        <message clientcredentialtype="UserName" algorithmsuite="Default" />
                    </transport></security>
                </readerquotas></binding>
            </basichttpbinding>
        </bindings>
        <client>
            <!--<endpoint address="http://localhost/Hello/" binding="basicHttpBinding">
                bindingConfiguration="BasicHttpBinding_IHello" contract="IHello"
                name="BasicHttpBinding_IHello" />-->
          <endpoint address="net.msmq://localhost:8080/Hello/">
          binding="netMsmqBinding"
          contract="IHello" />
        </endpoint></endpoint></client>
    </system.servicemodel>
</configuration>


and client code is-
C#
using System;
using System.ServiceModel.Channels;
using System.Configuration;
using System.Messaging;
using System.ServiceModel;
using System.Transactions;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace client
{
    class Program
    {
        static void Main(string[] args)
		{
			Console.WriteLine("Press any key when the service is available...");
			Console.ReadKey();
			
			HelloClient client = new HelloClient();
			
           Console.WriteLine("this is client and it means service is runing");
			Console.WriteLine("Press any key to quit...");
			Console.ReadKey();
		}
    }
}


I am mere begineer in this topic,and trying to learn WCF amd MSMQ.
Thanks in Advance
Posted
Updated 22-May-12 11:19am
v2

1 solution

Have a look at Sample Starter Project Using WCF and MSMQ[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
VJ Reddy 23-May-12 1:54am    
Useful reference for learners. 5!
Espen Harlinn 23-May-12 4:32am    
Thank you, VJ :-D
Wendelius 24-May-12 14:59pm    
Nice sample!
Espen Harlinn 24-May-12 17:26pm    
Thank you Mika :-D
Sandeep Mewara 25-May-12 0:57am    
Good link. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900