Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             //URL: http://snc.cpl.it:8130/sap/bc/srt/wsdl/flv_10002P111AD1/sdef_url/ZWS_GET_CUSTOMERS_LIST
  6.             //Username: WSDL_SAP
  7.             //Password: CPL,CONCORDIA1
  8.  
  9.             BasicHttpBinding basicHttpbinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
  10.             basicHttpbinding.Name = "BasicHttpBinding_YourName";
  11.             basicHttpbinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
  12.             //basicHttpbinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.;
  13.  
  14.             EndpointAddress endpointAddress = new EndpointAddress("http://snc.cpl.it:8130/sap/bc/srt/wsdl/flv_10002P111AD1/sdef_url/ZWS_GET_CUSTOMERS_LIST");
  15.             var service = new ServiceReference1.ZWS_GET_CUSTOMERS_LISTClient(basicHttpbinding, endpointAddress);
  16.             service.ClientCredentials.UserName.UserName = "WSDL_SAP";
  17.             service.ClientCredentials.UserName.Password = "CPL,CONCORDIA1";
  18.  
  19.  
  20.  
  21.             var customerList = new ServiceReference1.ZwsGetCustomersList();
  22.             customerList.ICodcliente = "12345";
  23.             customerList.INome = "Test";
  24.  
  25.             service.ZwsGetCustomersList(customerList);
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement