System.ServiceModel.BasicHttpBinding

Added in .NET Framework 3.0




Example


var soapURL = "http://"; 
var System.ServiceModel.BasicHttpBinding oBasicHttpBinding;

oBasicHttpBinding = new System.ServiceModel.BasicHttpBinding()[
oBasicHttpBinding.MaxReceivedMessageSize = 2147000000;
oBasicHttpBinding.MaxBufferSize = 2147000000;
oBasicHttpBinding.ReaderQuotas.MaxStringContentLength = 2147000000;
oBasicHttpBinding.OpenTimeout = new System.TimeSpan(0, 3, 0);
oBasicHttpBinding.SendTimeout = new System.TimeSpan(0, 3, 0);
oBasicHttpBinding.CloseTimeout = new System.TimeSpan(0, 3, 0);



var endpoint = new System.ServiceModel.EndpointAddress(soapURL);
var endPointBinding = new System.ServiceModel.BasicHttpBinding();
endPointBinding.MaxReceivedMessageSize = 2147000000;
endPointBinding.MaxBufferSize = 2147000000;
endPointBinding.ReaderQuotas.MaxStringContentLength = 2147000000;
endPointBinding.OpenTimeout = new System.TimeSpan(0, 3, 0);
endPointBinding.SendTimeout = new System.TimeSpan(0, 3, 0);
endPointBinding.CloseTimeout = new System.TimeSpan(0, 3, 0);
                               
var restService = new soapClient(endPointBinding, endpoint);
using (new System.ServiceModel.OperationContextScope(restService.InnerChannel))
{
   System.ServiceModel.HttpRequestMessageProperty requestMessage = new System.ServiceModel.HttpRequestMessageProperty();

   requestMessage.Headers["proxy-remote-user"] = System.Environment.UserName;

   System.ServiceModel.OperationContext.Current.OutgoingMessageProperties[
      System.ServiceModel.HttpRequestMessageProperty.Name] = requestMessage;

   restService.GetMethod();
}



Methods

  
  



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext