Ciao.

Tempo fa ho fatto un deploy di un sito web che utilizza un autocompletamento di una textbox con l'utilizzo di un webservice wcf. Tutto ok fino a che il sito non è stato messo su https il quale adesso questa funzionalità di auto completamento non funziona.
Cercando su internet ho trovato questa soluzione che ho implementato, ma non funziona piu' nulla:

<system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="MyApp.WUC.ServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="MyApp.WUC.Service">
        <endpoint address="" 
                  behaviorConfiguration="MyApp.WUC.ServiceAspNetAjaxBehavior" 
                  binding="webHttpBinding"
                  bindingConfiguration="webBindingsecure"
                  contract="MyApp.WUC.Service" />
        <endpoint address=""
                  behaviorConfiguration="MyApp.WUC.ServiceAspNetAjaxBehavior"
                  binding="webHttpBinding"
                  bindingConfiguration="webBinding"
                  contract="MyApp.WUC.Service" />
      </service>
    </services>
      <bindings>
          <webHttpBinding>
              <binding name="webBindingsecure">
                <security mode="Transport"></security>
              </binding>
              <binding name="webBinding">
                <security mode="None"></security>
              </binding>
          </webHttpBinding>
      </bindings>
  </system.serviceModel>


Questo è il sito dove ho preso el info:
http://weblogs.asp.net/srkirkland/archive/2008/02/20/wcf-bindings-needed-for-https.aspx

Dove sbaglio?
32 messaggi dal 29 marzo 2011
1) hai settato EnableGetHttps = "true", sul web config dove è stato hostato il servizio?

2)Prova ad invocare il servizio via WcfTestClient, e vedi se ti funziona correttamente. :-)

let me know
naty
vergnaty ha scritto:
1) hai settato EnableGetHttps = "true", sul web config dove è stato hostato il servizio?

2)Prova ad invocare il servizio via WcfTestClient, e vedi se ti funziona correttamente. :-)

let me know
naty


Scusa, riesci a farmi vedere come e dove devo inserire EnableGetHttps ? Considera che devo usare il servizio sia in http che in https.
vergnaty ha scritto:
1) hai settato EnableGetHttps = "true", sul web config dove è stato hostato il servizio?

2)Prova ad invocare il servizio via WcfTestClient, e vedi se ti funziona correttamente. :-)

let me know
naty


Ho provato in questo modo ma in dubug (quindi con il classico http) non funziona:

<system.serviceModel>
      
    <behaviors>
      <endpointBehaviors>
        <behavior name="MyApp.WUC.ServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>

        <serviceBehaviors>
            <behavior name="HttpGetMetadata">
                <serviceMetadata httpGetEnabled="true" />
            </behavior>
            <behavior name="HttpsGetMetadata">
                <serviceMetadata httpsGetEnabled="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>      
      
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="MyApp.WUC.Service" behaviorConfiguration="HttpsGetMetadata">
        <endpoint address="" 
                  behaviorConfiguration="MyApp.WUC.ServiceAspNetAjaxBehavior" 
                  binding="webHttpBinding"
                  bindingConfiguration="webBindingsecure"
                  contract="MyApp.WUC.Service" />        
      </service>
        <service name="MyApp.WUC.Service" behaviorConfiguration="HttpGetMetadata">
            <endpoint address=""
                        behaviorConfiguration="MyApp.WUC.ServiceAspNetAjaxBehavior"
                        binding="webHttpBinding"
                        bindingConfiguration="webBinding"
                        contract="MyApp.WUC.Service" />
        </service>
    </services>
      <bindings>
          <webHttpBinding>
              <binding name="webBindingsecure">
                <security mode="Transport"></security>
              </binding>
              <binding name="webBinding">
                <security mode="None"></security>
              </binding>
          </webHttpBinding>
      </bindings>
  </system.serviceModel>
32 messaggi dal 29 marzo 2011
Scusa, riesci a farmi vedere come e dove devo inserire EnableGetHttps ? Considera che devo usare il servizio sia in http che in https.



  <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata <b>httpsGetEnabled="true" httpGetEnabled="true" </b>/>
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>


cosi facendo abiliti in tutti i 2 casi.
Nulla da fare... non funziona...
httpsGetEnabled serve solo per abilitare i metadati sotto https, ma non per chiamare il servizio stesso.
Vedo che il servizio è già configurato con due binding diversi e uno con https. Se chiami l'endpoint (con fiddler o tool simili) che errore ottieni dal server?

Ciao

Il mio blog
Homepage

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.
Community
Ultimi messaggi
UTENTI ONLINE
    In primo piano

    I più letti di oggi

    Media
    In evidenza
    MISC