Click here to Skip to main content
15,938,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
1.) Via Creating Proxy with svcutil.exe and access their method.
C#
ServiceClient client = null;
               string endPointAddr = ConfigurationManager.AppSettings["endpointAddress"].ToString();
               EndpointAddress endpointAddress = new EndpointAddress(endPointAddr);

               BasicHttpBinding binding = new BasicHttpBinding();
               binding.MaxBufferPoolSize = 2147483647;
               binding.MaxBufferSize = 2147483647;
               binding.MaxReceivedMessageSize = 2147483647;
               TimeSpan timespan = new TimeSpan(0, 10, 0);
               binding.UseDefaultWebProxy = true;
               binding.ReaderQuotas.MaxArrayLength = 2147483647;
               binding.ReaderQuotas.MaxStringContentLength = 2147483647;
               binding.ReaderQuotas.MaxBytesPerRead = 2147483647;
               binding.ReaderQuotas.MaxNameTableCharCount = 2147483647;
               binding.TransferMode = TransferMode.Streamed;
               binding.SendTimeout = timespan;
               binding.ReceiveTimeout = timespan;
               binding.CloseTimeout = timespan;


               EndpointAddress endpoint = new EndpointAddress(new Uri(endPointAddr));
               client = new ServiceClient(binding, endpoint);
               //System.Threading.Thread.Sleep(10000);
               if (client.State != CommunicationState.Opened)
               {
                   if (client.State != CommunicationState.Opening)
                   {
                       client.Open();
                   }
               }
               return client;


2.) Hit httprequest directly from C# code behind. like below

http://localhost:61879/Services.svc"


Please suggest me the best option which I need to use or why?.

Thanks in advance.
Posted
Updated 6-Jul-15 23:18pm
v3
Comments
Herman<T>.Instance 8-Jul-15 11:14am    
Akram Ahmed 30-Jul-15 3:51am    
please let me know the exact difference. is there any security reason or something.

Thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900