Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Chiamata a WebService in https e certificato client

    Ciao, sto cercando di richiamare da un'applicazione .net (visualStudio 2010) un webservice che richiede la certificazione client e server.
    Ho installato i certificati necessari per la mia macchina.Ora sto provando a richiamare il ws ma continuo ad avere un errore e non so più che pesci pigliare.Qui sotto il mio codice:
    ServiceReference1.PortaleWebServiceClient ws = new ServiceReference1.PortaleWebServiceClient();


    ws.ClientCredentials.UserName.UserName = "userws";
    ws.ClientCredentials.UserName.Password = "pwdws";
    ws.ClientCredentials.ServiceCertificate.SetDefault Certificate(
    StoreLocation.LocalMachine,
    StoreName.My,
    X509FindType.FindBySubjectName,
    "mioCert");

    string esito = ws.MetododaRichiamare("par1");

    L'errore che mi dà è :

    Schema URI fornito 'https' non valido. Previsto 'http'.
    Nome parametro: via

    aggiungo anche l'app.config.. che sto andando a tentoni di configurare :

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="PortaleWebServiceSoapBinding" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <security mode="None">
    <transport clientCredentialType="Basic" proxyCredentialType="Basic"
    realm="">
    </transport>
    </security>
    </binding>
    </basicHttpBinding>
    </bindings>
    <client>
    <endpoint address="https://certificatoserver/portale/cxf/portaleWebService"
    binding="basicHttpBinding" bindingConfiguration="PortaleWebServiceSoapBinding "
    contract="ServiceReference1.IPortaleWebService" name="PortaleWebServicePort" />
    </client>


    </system.serviceModel>
    </configuration>


    garzie mille
    ciao

  2. #2
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    avavo lo stesso errore in un Ws WCF.

    Dipendeva dal config (qualcosa che riguardava il Transport), ero in ambiente Web.

    Devo trovarlo, ora non l'ho sotto mano.

  3. #3
    Sono riuscita a fare la chiamata al web service, come mi hai suggerito ho giocato un po' sul config e finalmente il ws mi ha risposto.Posto il config cosi come l'ho modificato, adesso mi rimane lo scoglio del proxy... come dico all'app di prendere le impostazioni del proxy configurate sul server?
    Grazie

    <binding name="PortaleWebServiceSoapBinding" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <security mode="Transport">
    <transport clientCredentialType="Basic" proxyCredentialType="Windows"
    realm="">
    </transport>
    </security>
    </binding>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.