WCF chiamata getta: “Lo schema URI fornito 'http' non è valido; .”Eccezione prevista 'net.tcp'

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

  •  16-09-2019
  •  | 
  •  

Domanda

Ho un servizio WCF ospitato in IIS7.

Questa è l'app.config per il mio servizio in hosting in 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>

E sotto è l'app.config nel client che fa riferimento al servizio 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>

Per qualche motivo ho ancora "Lo schema URI fornito 'http' non è valido; atteso 'net.tcp'." fa eccezione.

Non riesco a capire perché .....

È stato utile?

Soluzione

In realtà si scopre mi mancava l'endpoint mex ... woops

Altri suggerimenti

Forse questo

<serviceMetadata httpGetEnabled="true" />

Si sta chiedendo di abilitare HTTP su un servizio TCP, che sembra come esso potrebbe causare alcuni problemi.

Il mio problema è che il behaviorConfiguration nel web.config è cancellato dopo rinfresco la la Service References.

(La mia behaviorConfiguration utilizza un indirizzo clientVia piuttosto che un indirizzo dell'endpoint standard per permettergli di attraversare il firewall).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top