This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 5th, 2011  |  syntax: C#  |  size: 1.15 KB  |  views: 90  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     public static class WSGateway
  2.     {
  3.         private static WSHttpBinding binding;
  4.         private static EndpointAddress endpointAddress;
  5.    
  6.         static WSGateway()
  7.         {
  8.             var readerQuotas = new XmlDictionaryReaderQuotas()
  9.             {
  10.                 MaxDepth = 6000000,
  11.                 MaxStringContentLength = 6000000,
  12.                 MaxArrayLength = 6000000,
  13.                 MaxBytesPerRead = 6000000,
  14.                 MaxNameTableCharCount = 6000000
  15.             };
  16.             binding = new WSHttpBinding(SecurityMode.None) {MaxReceivedMessageSize = 6000000, ReaderQuotas = readerQuotas};
  17.    
  18.             endpointAddress = new EndpointAddress("http://machine:28666/DBInteractionGateway.svc");
  19.         }
  20.         public static DBInteractionGatewayClient MR_WebService
  21.         {
  22.             get
  23.             {
  24.                 return new DBInteractionGatewayClient(binding, endpointAddress);
  25.             }
  26.         }
  27.         public static void ExecuteCommand(Action<DBInteractionGatewayClient> command)
  28.         {
  29.             var ws = MR_WebService;
  30.             command.Invoke(ws);
  31.             ws.Close();
  32.         }
  33.     }
  34.  
  35.  
clone this paste RAW Paste Data