Solved

Problem with WCF and MSMQ

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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 …

947 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now