2011-02-01 10 views
18

Ho configurato i miei servizi WCF per funzionare con SSL ma funziona SOLO se il collegamento HTTP esiste nel sito Web IIS. Quando si associa l'HTTP non esiste ed esiste solo HTTPS vincolante ottengo il seguente errore:Come configurare i servizi WCF affinché funzionino tramite HTTPS senza binding HTTP?

The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.

Come posso risolvere questo problema?

Grazie.

+0

Potrebbe spiegare che cosa significa esattamente "funziona solo se vincolante HTTP esiste"? Grazie ... sto affrontando lo stesso problema nel mio wcf .. WCf funziona bene su un server ma non sull'altro .. :( – Lamps

risposta

44

Modificare la configurazione in questo modo:

<behaviors> 
    <serviceBehaviors> 
    <behavior> <!-- behavior can have name (must have name in WCF 3.x) --> 
     <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
+1

Sto affrontando lo stesso problema .. Ma succede solo in pochi server .. I servizi ospitati su un server stanno funzionando bene e altri server stanno lanciando l'errore citato in questione .. Qualche idea ? Grazie. – Lamps

4

è necessario utilizzare mexHTTPSBinding Unstead di mexHTTPBinding

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
+0

Questa non è la causa del problema dell'OP, ma è vera se si definisce l'endpoint dei metadati in quanto deve essere disponibile su 'https'. – Darbio

Problemi correlati