I´m building a winform client using VS 2013. I want to consume a 3party java secure and external (using https with certificate) web service.
I have access to the wsdl. I added a service reference to my .net project referencing the address of the Endpoint and I configured my web.config with wsHttpBinding and transport. ( I have also tried with basicHttpBinding )
In code, I create a client service object and I can see its methods and data types normally.
I have seen that as soon as I create the object, the InnerChannel property is in faulted state mode and I do not understand why.
The problem is that when calling any of the service object methods, It gives the error:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll
'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
Additional information: The communication object, System.ServiceModel.ChannelFactory`1 [myproyect.SR.NotificaWsPortType], can not be used for communication because it is in the Faulted state.
Additional information: There was an error reflecting 'return'.
Can anybody help me?
web.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="NotificaWsBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://<address here>"
binding="wsHttpBinding" bindingConfiguration="NotificaWsBinding"
contract="SR.NotificaWsPortType" name="NotificaWsPort" />
</client>
</system.serviceModel>
</configuration>