I have a service configuration as following:
<system.serviceModel>
<client/>
<services>
<service name="MaxClientWcfService.ClientService" behaviorConfiguration="ServiceBehaviour">
<endpoint name="testbasicEndpoint" address="" binding="basicHttpBinding" bindingConfiguration="myBasicBinding" contract="MaxClientWcfService.IClientService"/>
</services>
<bindings>
<basicHttpBinding>
<binding name="myBasicBinding" closeTimeout="01:50:00" openTimeout="01:50:00" receiveTimeout="01:50:00" sendTimeout="01:50:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="Transport">
<transport clientCredentialType="Certificate"></transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
<dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483646"/>
</behavior>
<behavior name="ServiceBehaviourForIIS">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
<dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483646"/>
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
My Client configuration is like:
<bindings>
<netTcpBinding>
<binding name="netTcpBinding" closeTimeout="01:50:00" openTimeout="01:50:00"
receiveTimeout="01:50:00" sendTimeout="01:50:00" maxReceivedMessageSize="2147483647">
<reliableSession inactivityTimeout="00:10:00" enabled="true" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://127.0.0.1:1451/CardProWCFService"
binding="netTcpBinding" bindingConfiguration="netTcpBinding"
contract="HostService.ICardProWCFService" name="netTcpBinding" />
<endpoint address="https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc"
binding="basicHttpsBinding" bindingConfiguration="testbasicEndpoint"
contract="MAXServiceReferenceClient.IClientService" name="testbasicEndpoint" behaviorConfiguration="endpointCredentialBehavior" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="endpointCredentialBehavior">
<clientCredentials>
<clientCertificate findValue="XXXXXXXXXXXXXXXXXXXXXX"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint" />
<serviceCertificate >
<authentication certificateValidationMode="PeerTrust"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
When i test this one over the Visual Studio WCF Test Client, I am getting following error:
Error: Cannot obtain Metadata from https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc Metadata contains a reference that cannot be resolved: 'https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc'. Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost:9090'. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure.HTTP GET Error URI: https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc There was an error downloading 'https://localhost:9090/MAXxEMVIISSAAS_11June2020/maxclientservice/ClientService.svc'. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure.**
Please I will be thankful for any help!