Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. #region Namespaces
  2. using System;
  3. using System.Data;
  4. using Microsoft.SqlServer.Dts.Runtime;
  5. using System.Windows.Forms;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.ServiceModel;
  12. #endregion
  13.  
  14. namespace ST_c9ff0d0cdf0a455e804af51f85eb8494
  15. {
  16. enum ScriptResults
  17. {
  18. Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
  19. Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure,
  20.  
  21. };
  22.  
  23.  
  24. [Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
  25. public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
  26. {
  27.  
  28. public void Main()
  29. {
  30.  
  31. var binding = new BasicHttpBinding();
  32. binding.Security.Mode = BasicHttpSecurityMode.Transport;
  33. binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
  34. binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic;
  35. binding.Security.Transport.Realm = "";
  36. binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Default;
  37. var endpointAddress = new EndpointAddress("Web Service URL");
  38. dmvcrashns.RMSIntegrationServiceSoapClient soapClient = new dmvcrashns.RMSIntegrationServiceSoapClient(binding, endpointAddress);
  39. soapClient.ClientCredentials.UserName.UserName = "username";
  40. soapClient.ClientCredentials.UserName.Password = "password";
  41.  
  42.  
  43.  
  44. dmvcrashns.FindLEApprovedCrashesRequest r = new dmvcrashns.FindLEApprovedCrashesRequest();
  45. r.pStart = new DateTime(2016, 09, 01);
  46. r.pEnd = new DateTime(2017, 01, 01);
  47.  
  48. dmvcrashns.RMSIntegrationServiceSoapClient c = new dmvcrashns.RMSIntegrationServiceSoapClient();
  49. var resp = c.FindLEApprovedCrashes(new dmvcrashns.TREDSCredentials() {
  50. Password = "username",
  51. UserName = "password" },
  52. r.pStart, r.pEnd);
  53.  
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement