Solved

Problem with WCF and MSMQ

Posted on 2008-06-13
4
2,579 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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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