Failed to consume WCF by ChannelFactory C #

0

This is my contract:

[ServiceContract]
public interface ILoginNetSSO

This is the way I invoke it from the page_load method:

BasicHttpBinding myBinding = new BasicHttpBinding();
EndpointAddress myEndpoint = new EndpointAddress("https://google.com.mx/Login.IT.Web.Servicios.SSO/LoginNetSSO.svc");
ChannelFactory<ILoginNetSSO> myChannelFactory = new ChannelFactory<ILoginNetSSO>(myBinding, myEndpoint);
ILoginNetSSOwcfClient1 = myChannelFactory.CreateChannel(myEndpoint);

This error is generated:

  

The name of the type or namespace 'ILoginNetSSO' is not   found (missing a using directive or an assembly reference?)

It is worth mentioning that the address is not the real one, but even consuming the real address generates the same error, I consult the service through a web browser and it shows me the methods.

    
asked by Francisco Guillermo Herrera Ga 12.05.2017 в 21:01
source

1 answer

0

Try it this way:

var binding = new WSHttpBinding
        {
            Security = { Mode = SecurityMode.None },
            ReaderQuotas = { MaxStringContentLength = Int32.MaxValue },
            MaxReceivedMessageSize = 2097152,
            MaxBufferPoolSize = 2097152
        };

        var endpoint = ConfigurationManager.AppSettings["EndpointAddress"];
        var channel = new ChannelFactory<ILoginNetSSO>(binding, endpoint);

        var proxy = channel.CreateChannel();

Greetings

    
answered by 13.05.2017 в 03:18