0

我正在尝试设置我的服务wsHttpBinding。服务页面在 Firefox 中加载得很好,但是当使用 WCFTestClient 发出请求时,会触发错误异常,因为它显然EndPoint出于某种原因试图访问 mex。如您所见,我什至没有列出 mex,这是配置:

<system.serviceModel>    
    <services>
      <service name="WorkFlowManagement" behaviorConfiguration="WorkFlowManagementBehavior">
        <endpoint binding="wsHttpBinding" contract="IWorkflowManagement"
                  bindingConfiguration="WSHttpBinding_IWorkflowManagement"
                  name="WSHttpBinding_IWorkflowManagement"/>
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IWorkflowManagement" maxBufferPoolSize="999965536"
                 maxReceivedMessageSize="999965536" messageEncoding="Text" textEncoding="utf-8">
          <readerQuotas maxArrayLength="999965536" maxBytesPerRead="999965536" maxDepth="999965536"
                        maxNameTableCharCount="999965536" maxStringContentLength="999965536"/>
          <security mode="None"/>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WorkFlowManagementBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <sqlWorkflowInstanceStore
            connectionString="my connection string"
           instanceEncodingOption="None" instanceCompletionAction="DeleteAll" instanceLockedExceptionAction="BasicRetry" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:02" />
          <workflowIdle timeToUnload="0"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
      <serviceActivations>
        <add factory="SecAmerInc.STPCore.Services.WorkFlowManagment.WFServiceFactory"
             relativeAddress="./WorkFlowManagement.xamlx"
             service="WorkFlowManagement.xamlx"/>
      </serviceActivations>
    </serviceHostingEnvironment>
  </system.serviceModel>

然而,这是异常消息:

由于 EndpointDispatcher 的 AddressFilter 不匹配,接收方无法处理带有“http://localhost/SecAmerInc.STPCore.Services.WorkFlowManagement/WorkFlowManagement.xamlx/mex”的消息。检查发送方和接收方的 EndpointAddresses 是否一致。

这是 WCFTestClient 的配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IWorkflowManagement" sendTimeout="00:05:00">
                    <security mode="None" />
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost/SecAmerInc.STPCore.Services.WorkFlowManagement/WorkFlowManagement.xamlx"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWorkflowManagement"
                contract="IWorkflowManagement" name="WSHttpBinding_IWorkflowManagement" />
        </client>
    </system.serviceModel>
</configuration>
4

1 回答 1

0

MEX(元数据交换)端点将有关您的服务的元数据发送给调用者。该工具可能需要您的元数据来了解如何与您的服务进行通信。如果您想使用此工具进行测试,请定义您的 MEX 端点。

于 2013-01-08T20:58:09.347 回答