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