1
votes

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.

Show my code in debug mode

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>
1
I configured...wsHttpBinding and transport - you should not be using this binding because it is not interoperable. Use basicHttpBinding instead. This should have been chosen for you when you consumed the service metadata.tom redfern
Thanks for your reply. Initially I used basicHttpBinding but it does not work either. I still have the same problem.Mowai

1 Answers

0
votes

I finally found the answer. There was a problem mapping the webservice in .NET because the webservice was developed in java and had a problem whit microsoft technology. So I spoke with the service providers and they did not have any problems with java but with .net. They changed something in their internals and it worked for me.