开发者

WCF service with WAS: service cannot convert queue's path name

I got a WCF service listening on a via WAS on a MSMQ which is located on a different server within the same domain.

The setup looks like this:

Server A: Windows Server 2008 hosts the WCF service on IIS.

Server B: Windows Server 2008 (Domain Controller) hosts the private MSMQ (AD Integration).

Furthermore I got also a console client running on Server A which sends message to the service via the MSMQ also using WCF. At the moment the whole setup works and the service processes the messages from the client. The client's security mode is set to transport and the service's security mode is set to none.

But when I switch the security mode of the service also to transport the message are not processed any more. I activated tracing on the service and found out that there seems to be a problem when the service tries to access the MSMQ on the other server. A warning and a error message (see below) can be seen on both security modes none and transport, but when set to none the service seems to ignore the problem and processes the messages never the less.

The error message says:

An error occurred when converting the 'murdock.ltportale.intern\private$\EventSyncService/EventSynchorinzationService.svc' queue path name to the format name: Unrecognized error -1072824300 (0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.

I don't think that the address of the MSMQ is wrong as the service can find it with security mode none. I'm also quite sure that MSMQ runs with AD integration as this took me 2 days to get it working on my environment.

At the moment I have no clue what I'm doing wrong. Running the setup without transport security mode is no option for me as my next step would be activating transactions. And I think if transport mode won't work then transaction mode won't work either.


Warning message:

 ...
 <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
     <TraceIdentifier>
         http://msdn.microsoft.com/de-DE/library/System.ServiceModel.Channels.MsmqQueueTransactionalStatusUnknown.aspx
     </TraceIdentifier>
     <Description>
         Cannot detect if the queue is transactional.
     </Description>
     <AppDomain>
         /LM/W3SVC/3/ROOT/EventSyncService-1-129509714416559522
     </AppDomain>
     <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/StringTraceRecord">                               
         <FormatName> 
              DIRECT=OS:murdock.ltportale.intern\private$\EventSyncService/EventSynchorinzationService.svc
         </FormatName>
     </ExtendedData>
  </TraceRecord>
  ...

Error message:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131075</EventID>
        <Type>3</Type>
        <SubType Name="Error">0</SubType>
        <Level>2</Level>
        <TimeCreated SystemTime="2011-05-27T12:04:11.5292297Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{f89d797c-3d10-47a3-8dad-1b3200d3b868}" />
        <Execution ProcessName="w3wp" ProcessID="1764" ThreadID="6" />
        <Channel />
        <Computer>SPS2010-FBE</Computer>
    </System>
    <ApplicationData>
        <TraceData>
            <DataItem>
                <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
                    <TraceIdentifier>
                        http://msdn.microsoft.com/de-DE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx
                    </TraceIdentifier>
                    <Description>Throwing an exception.</Description>
                    <AppDomain>/LM/W3SVC/3/ROOT/EventSyncService-1-129509714416559522
                    </AppDomain>
                    <Exception>
                        <ExceptionType>
                            System.ServiceModel.MsmqException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
                        </ExceptionType>
                        <Message>
                            An error occurred when converting the 'murdock.ltportale.intern\private$\EventSyncService/EventSynchorinzationService.svc' queue path name to the format name: Unrecognized error -1072824300 (0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.
                        </Message>
                        <StackTrace>
                               at System.ServiceModel.Channels.MsmqFormatName.FromQueuePath(String queuePath)
                               at System.ServiceModel.Channels.MsmqVerifier.VerifyReceiver(MsmqReceiveParameters receiveParameters, Uri listenUri)
                               at System.ServiceModel.Channels.MsmqTransportBindingElement.BuildChannelListener[TChannel](BindingContext context)
                               at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()
                               at System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener[TChannel](BindingContext context)
                               at System.ServiceModel.Channels.BinaryMessageEncodingBindingElement.BuildChannelListener[TChannel](BindingContext context)
                               at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()
                               at System.ServiceModel.Channels.Binding.BuildChannelListener[TChannel](Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters)
                               at System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener&amp;amp; result, Boolean supportContextSession)
                               at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener&amp;amp; result)
                               at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
                               at System.ServiceModel.ServiceHostBase.InitializeRuntime()
                               at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
                               at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
                               at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
                               at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
                               at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
                               at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
                               at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
                               at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
                               at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
                               at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
                               at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
                               at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state)
                               at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
                               at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
                               at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
                        </StackTrace>
                        <ExceptionString>
                            System.ServiceModel.MsmqException: An error occurred when converting the 'murdock.ltportale.intern\private$\EventSyncService/EventSynchorinzationService.svc' queue path name to the format name: Unrecognized error -1072824300 (0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.
                        </ExceptionString>
                    </Exception>
                </TraceRecord>
            </DataItem>
        </TraceData>
    </ApplicationData>
</E2ETraceEvent>

Configuration client

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
      <bindings>
        <netMsmqBinding>
          <binding name="MsmqBindingNonTransactionalNoSecurity" exactlyOnce="false">
            <security mode="None"/>
          </binding>
          <binding name="MsmqBindingNonTransactionalTransportSecurity" exactlyOnce="false">
            <security mode="Transport"/>
          </binding>
        </netMsmqBinding>
      </bindings>
      <client>
        <endpoint name="EventSyncService.EventSynchorinzationService"
                  address="net.msmq://murdock.ltportale.intern/private/EventSyncService/EventSynchorinzationService.svc"
                  binding="netMsmqBinding" 
                  bindingConfiguration="MsmqBindingNonTransactionalTransportSecurity"
                  contract="SyncService.IEventSynchorinzationService" />
      </client>
    </system.serviceModel>
</configuration>

Configuration service

...
 <system.serviceModel>
    <bindings>
      <netMsmqBinding>
        <binding name="MsmqBindingNonTransactionalNoSecurity" exactlyOnce="false">
          <security mode="None" />
        </binding>
        <binding name="MsmqBindingNonTransactionalTransportSecurity" exactlyOnce="false">
          <security mode="Transport"/>
        </binding>
      </netMsmqBinding>
    </bindings>
    <services>
      <service name="EventSyncService.EventSynchorinzationService">
        <endpoint 
                  address="net.msmq://murdock.ltportale.intern/private/EventSyncService/EventSynchorinzationService.svc" 
                  binding="netMsmqBinding" 
                  bindingConfiguration="MsmqBindingNonTransactionalNoSecurity" 
                  contract="EventSyncService.IEventSynchorinzationService" />
      </service>
    </services>
  </system.serviceModel>
  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.D开发者_运维问答iagnostics.XmlWriterTraceListener"
              initializeData= "c:\log\log.txt" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜