Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. System.Net.NetworkCredential creds = GetNetWorkCredentials();
  2. BasicHttpBinding binding = new BasicHttpBinding();
  3. binding.Security.Mode = BasicHttpSecurityMode.Transport;
  4. binding.Security.Transport.ClientCredentialType = creds.httpClientCredentialType;
  5. ChannelFactory<Portal.WebServices.Internal.IPort> factory = new ChannelFactory<Portal.WebServices.Internal.IPort>(binding);
  6. factory.Credentials.Windows.ClientCredential = creds;
  7. factory.Credentials.UserName.UserName = creds.UserName;
  8. factory.Credentials.UserName.Password = creds.Password;
  9. Portal.WebServices.Internal.IPort proxy = factory.CreateChannel(new EndpointAddress(siteURL + "/_vti_bin/portal/Port.svc"));
  10. Portal.WebServices.Internal.FewObject[] invoices = proxy.GetInvoices(IDs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement