Friday, December 12, 2014

Consuming Rest Service

            BasicHttpBinding basicHttpbinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
            basicHttpbinding.Name = "BasicHttpBinding_temp";
            basicHttpbinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            basicHttpbinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
            EndpointAddress endpointAddress = new EndpointAddress("http://siteurl/Service.svc");

Create an object for the service referenced and pass the above two objects as its constructor parameter

No comments:

Post a Comment

How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...