Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with WCF and MSMQ

Posted on 2008-06-13
4
Medium Priority
?
2,637 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 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