Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with WCF and MSMQ

Posted on 2008-06-13
4
Medium Priority
?
2,652 Views
Last Modified: 2013-12-17
I have a WCF service that I have exposed a msmq binding.  The msmq is setup as a public queue - I have grated full control to 'everyone'.  I have a .net 3.5 project that I add the wcf service as a service reference.  It finds it and adds all the necessary bindings.  The service is on a server on our domain.  I can attach to and interact with the service.  I deploy the web site to the same server that the WCF is running on.  The entire site work fine until I call the service, and I get the messaage below.  I have checked and there are 2 certificates on the queue - one for admin and another for the developer machine name.  I have tried every different permission setting I can think of - what do I need to do to get this to work?

An error occurred while sending to the queue: No internal Message Queuing certificate exists for the user. (-1072824273, 0xc00e002f).Ensure that MSMQ is installed and running. If you are sending to a local queue, ensure the queue exists with the required access mode and authorization.
0
Comment
Question by:Hammermaninmd
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:ozymandias
ID: 21788712
Are you using (Windows Server 2003 + MSMQ 3) or (Windows Server 2008 + MSMQ 4) ?

If you are using (Windows Server 2003 + MSMQ 3) I would not recommend using public queues.
Use private queues.

Also I would need to see your client and server side msmq bindings.
0
 
LVL 2

Author Comment

by:Hammermaninmd
ID: 21790502
Hello thanks so much for gettign back to me.. we are running Windows Server 2003 with MSMQ 3.  I thought that public queue where for exhcanges from machines from one server on the network to another.  In this case we are on a testing server, so the www site is talking to the WCF on the same box - in production it will be the WCF on one box and the WWW app on another - does that make a difference?  Please find my config for both client and service.. thanks so much for your help.  As an fyi our service is kind of central email sender - we have many different business process that need to pump out email so we decided to make all email be processed and sent from this service..
---- Server -------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<system.serviceModel>
		<diagnostics>
			<messageLogging maxMessagesToLog="30000"
							logEntireMessage="true"
							logMessagesAtServiceLevel="true"
							logMalformedMessages="true"
							logMessagesAtTransportLevel="true">
			</messageLogging>
		</diagnostics>
		<services>
	      <!-- Before deployment, you should remove the returnFaults behavior configuration to avoid disclosing information in exception messages -->
	      <service name="OurCompany.Public.Services.EmailEngine.EmailWCF" behaviorConfiguration="returnFaults">
	        <!--<endpoint address="http://localhost:8081/EmailEngine/EmailWCF" 
				      binding="wsHttpBinding"
				      contract="OurCompany.Public.Services.EmailEngine.IEmailWCF"/>-->
			<!-- Define NetMsmqEndpoint -->
			<host>
			  <baseAddresses>
			    <add baseAddress="http://localhost:8081/EmailEngine/EmailWCF"/>
			  </baseAddresses>
			</host>
			<endpoint name="msmqEmailEngine" address="net.msmq://localhost/EmailEngine"
				binding="netMsmqBinding"
				contract="OurCompany.Public.Services.EmailEngine.IEmailWCF" />
			<endpoint address="mex"
                binding="mexHttpBinding"
                contract="IMetadataExchange" />
		  </service>
		</services>
		<behaviors>
	      <serviceBehaviors>
	        <behavior name="returnFaults" >
	          <serviceDebug includeExceptionDetailInFaults="true" />
				<serviceMetadata httpGetEnabled="true" 
					             httpGetUrl="http://localhost:8081/EmailEngine/EmailWCF"/>
			</behavior>
		  </serviceBehaviors>
		</behaviors>
	</system.serviceModel>
	<system.diagnostics>
		<sources>
			<source name="System.ServiceModel"
					switchValue="Verbose, ActivityTracing"
					propagateActivity="true" >
				<listeners>
					<add name="xml" />
				</listeners>
			</source>
			<source name="System.ServiceModel.MessageLogging"
					switchValue="Verbose">
				<listeners>
					<add name="xml" />
				</listeners>
			</source>
		</sources>
		<sharedListeners>
			<add name="xml"
				 type="System.Diagnostics.XmlWriterTraceListener"
				 initializeData="TraceFileServer.e2e" />
		</sharedListeners>
		<trace autoflush="true" />
	</system.diagnostics>
	<appSettings>
		<add key="Acct.ConnectionString" value="our conn string"/>
		<add key="Admin.ConnectionString" value="our conn string"/>
		<add key="AccountDB" value="myvale"/>
		<add key="QueueName" value=".\EmailEngine"/>
	</appSettings>
</configuration>
 
---- Client ----------
<system.serviceModel>
                             <bindings>
                                 <netMsmqBinding>
                                     <binding name="msmqEmailEngine" closeTimeout="00:01:00" openTimeout="00:01:00"
                                         receiveTimeout="00:10:00" sendTimeout="00:01:00" deadLetterQueue="System"
                                         durable="true" exactlyOnce="true" maxReceivedMessageSize="65536"
                                         maxRetryCycles="2" receiveErrorHandling="Fault" receiveRetryCount="5"
                                         retryCycleDelay="00:30:00" timeToLive="1.00:00:00" useSourceJournal="false"
                                         useMsmqTracing="false" queueTransferProtocol="Native" maxBufferPoolSize="524288"
                                         useActiveDirectory="false">
                                         <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                                             maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                                         <security mode="Transport">
                                             <transport msmqAuthenticationMode="WindowsDomain" msmqEncryptionAlgorithm="RC4Stream"
                                                 msmqProtectionLevel="Sign" msmqSecureHashAlgorithm="Sha1" />
                                             <message clientCredentialType="Windows" />
                                         </security>
                                     </binding>
                                 </netMsmqBinding>
                             </bindings>
                             <client>
                                 <endpoint address="net.msmq://titan/EmailEngine" binding="netMsmqBinding"
                                     bindingConfiguration="msmqEmailEngine" contract="EmailEngineProxy2.IEmailWCF"
                                     name="msmqEmailEngine" />
                             </client>
                         </system.serviceModel>

Open in new window

0
 
LVL 15

Accepted Solution

by:
ozymandias earned 2000 total points
ID: 21791176
Public queues are simply queues that get published in Active Directory and are therefore serachable or discoverable.
However, there are issues with them so I would avoid using them if possible.

To test the service I would start off with private queues and set up a test MSMQ Binding that implements no security (see below).

Once you are happy with it working implement security on the binding properly and retest.

There is no really good reason to use public queues.
In fact, if you read Juval Lowy's book on WCF, he specifically recommends against it.


<endpoint address="net.msmq://localhost/private/MyQueueName"
            binding="netMsmqBinding" bindingConfiguration="NoMSMQSecurity"
            contract="IMyContract" name="MSMQTest" />
 
<netMsmqBinding>
    <binding name="NoMSMQSecurity" >
       <security mode="None" >
       </security>
    </binding>
</netMsmqBinding>

Open in new window

0
 
LVL 2

Author Closing Comment

by:Hammermaninmd
ID: 31467131
Thanks  - that did the trick we will add back what we need when we need to and I'm buying that book now..
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question