يلقي دعوة WCF: "نظام URI المتوفر" HTTP "غير صالح؛ المتوقع "net.tcp". استثناء

StackOverflow https://stackoverflow.com/questions/1474134

  •  16-09-2019
  •  | 
  •  

سؤال

لدي خدمة WCF المستضافة في IIS7.

هذا هو App.config لخدمتي المستضافة في IIS

<system.serviceModel>
  <bindings />
  <services>
    <service behaviorConfiguration="querierSearch.Querier.WCF.QuerierBehavior"
      name="querierSearch.Querier.WCF.Querier">
      <endpoint 
         address="net.tcp://localhost:808/querierSearch.Querier.WCF/Querier.svc"
        binding="netTcpBinding" bindingConfiguration="" name="EndPointTCP"
        contract="querierSearch.Querier.WCF.IQuerier" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="querierSearch.Querier.WCF.QuerierBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

وتحت app.config في العميل الذي يشير إلى خدمة WCF.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="EndPointTCP" closeTimeout="00:01:00" 
          openTimeout="00:01:00"
          receiveTimeout="00:10:00" sendTimeout="00:01:00" 
          transactionFlow="false" transferMode="Buffered" 
          transactionProtocol="OleTransactions"
          hostNameComparisonMode="StrongWildcard" listenBacklog="10" 
          maxBufferPoolSize="524288"
          maxBufferSize="65536" maxConnections="10" 
          maxReceivedMessageSize="65536">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" 
          axArrayLength="16384" maxBytesPerRead="4096" 
          maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
            enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" 
            protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="net.tcp://localhost/Search.Querier.WCF/Querier.svc"
        binding="netTcpBinding" bindingConfiguration="EndPointTCP"
        contract="SearchQueryService.IQuerier"
        name="EndPointTCP">
        <identity>
          <userPrincipalName value="joeuser@company.com" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

لسبب ما ما زلت أحصل على "نظام URI المزيف" غير صالح؛ المتوقع "net.tcp". " استثناء .

لا أستطيع أن أعلم لماذا.....

هل كانت مفيدة؟

المحلول

في الواقع اتضح أنني كنت في عداد المفقودين نقطة النهاية MEX ... Woops

نصائح أخرى

ربما هذا

<serviceMetadata httpGetEnabled="true" />

أنت تطلبها تمكين HTTP على خدمة TCP، والتي تبدو وكأنها قد تسبب بعض المشاكل.

مشكلتي هي أن behaviorConfiguration في web.config هو تم الحذف بعد أن قمت بتحديث Service References.

(لي behaviorConfiguration يستخدم أ clientVia العنوان بدلا من عنوان نقطة النهاية القياسية للسماح له باجتياز جدار الحماية).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top