簡體   English   中英

wcf配置設置問題,端點默認為mex

[英]wcf config setup issue, endpoint defaults to mex

我正在嘗試使用wsHttpBinding設置我的服務。 服務頁面在firefox中加載得很好,但是當使用WCFTestClient發出請求時,會引發故障異常,因為它顯然出於某種原因試圖訪問mex EndPoint 如您所見,我什至沒有列出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不匹配,因此無法在接收方處理帶有To'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>

MEX(元數據交換)端點將有關您的服務的元數據發送給呼叫者。 該工具可能需要您的元數據來了解如何與您的服務進行通信。 如果要使用此工具進行測試,請定義您的MEX端點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM