Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. public void Main()
  2. {
  3. // TODO: Add your code here
  4.  
  5. // TODO: Add your code here
  6. MessageBox.Show((string)Dts.Variables["ServiceDateStart"].Value);
  7.  
  8. string userName = "xxx";
  9. string password = "xxx";
  10. string licenceID = "xxx";
  11. ServiceReference.AuthenticationHeader a = new ServiceReference.AuthenticationHeader();
  12. a.LicenceID = new Guid(licenceID);
  13. a.UserName = userName;
  14. a.Password = password;
  15. ServiceReference.CompanyAccountXmlServiceSoapClient service = new ServiceReference.CompanyAccountXmlServiceSoapClient();
  16.  
  17. string result;
  18. long numberOfResults;
  19. int counter1 = 0;
  20. int counter2 = 19;
  21.  
  22.  
  23.  
  24. do
  25. {
  26.  
  27.  
  28.  
  29. result = service.GetCompanyAccountUpdated(a, (string)Dts.Variables["ServiceDateStart"].Value, (string)Dts.Variables["ServiceDateEnd"].Value, counter1, counter2);
  30. //result = service.GetCompanyAccountUpdated(a, "20150101", "20150107", counter1, counter2);
  31. counter1 = counter1 + 20;
  32. counter2 = counter2 + 20;
  33.  
  34.  
  35.  
  36. using (System.IO.StreamWriter file =
  37. new System.IO.StreamWriter(@"C:UsersjkrnetaDocumentsGetCompanyAccountUpdated.txt", true))
  38. {
  39.  
  40.  
  41. file.WriteLine(result);
  42.  
  43.  
  44. }
  45.  
  46. } while (!result.Equals("<CompanyAccountDataSet />"));
  47.  
  48.  
  49. Dts.TaskResult = (int)ScriptResults.Success;
  50. }
  51.  
  52. ServiceReference.CompanyAccountXmlServiceSoapClient service = new ServiceReference.CompanyAccountXmlServiceSoapClient();
  53.  
  54. <?xml version="1.0" encoding="utf-8" ?>
  55. <configuration>
  56. <system.serviceModel>
  57. <bindings>
  58. <basicHttpBinding>
  59. <binding name="CompanyAccountXmlServiceSoap">
  60. <security mode="Transport" />
  61. </binding>
  62. <binding name="CompanyAccountXmlServiceSoap1" />
  63. </basicHttpBinding>
  64. </bindings>
  65. <client>
  66. <endpoint address="https://webservices.nbs.rs/CommunicationOfficeService1_0/CompanyAccountXmlService.asmx"
  67. binding="basicHttpBinding" bindingConfiguration="CompanyAccountXmlServiceSoap"
  68. contract="ServiceReference.CompanyAccountXmlServiceSoap" name="CompanyAccountXmlServiceSoap" />
  69. </client>
  70. </system.serviceModel>
  71. </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement