appel WCF lance: « Le schéma d'URI fourni « http » est invalide; attendu 'net.tcp'. » exception

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

  •  16-09-2019
  •  | 
  •  

Question

J'ai un service WCF hébergé dans IIS7.

Ceci est le app.config pour mon service hébergé dans 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>

Et ci-dessous est le app.config dans le client qui fait référence au service 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>

Pour une raison quelconque, je reçois encore « Le schéma d'URI fourni « http » est pas valide, attendu « net.tcp ». » exception.

Je ne peux pas comprendre pourquoi .....

Était-ce utile?

La solution

En fait, il se trouve que je manquais le point final de ... MEX woops

Autres conseils

Peut-être cela

<serviceMetadata httpGetEnabled="true" />

Vous demandez à activer HTTP sur un service TCP, ce qui semble que cela pourrait causer des problèmes.

Mon problème est que le behaviorConfiguration dans le web.config est supprimé après que je l'actualiser la Service References.

(My behaviorConfiguration utilise une adresse clientVia plutôt que d'une adresse de point de terminaison standard pour lui permettre de traverser le pare-feu).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top