Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private VesselSchedule_OutClient GetSvc()
- {
- var binding = new CustomBinding();
- var tmb = new TextMessageEncodingBindingElement
- {
- MaxReadPoolSize = 64,
- MaxWritePoolSize = 16,
- WriteEncoding = Encoding.UTF8,
- MessageVersion = MessageVersion.Soap11,
- ReaderQuotas =
- {
- MaxDepth = 10000000,
- MaxStringContentLength = 10000000,
- MaxArrayLength = 67108864,
- MaxBytesPerRead = 65536,
- MaxNameTableCharCount = 100000
- }
- };
- binding.Elements.Add(tmb);
- binding.Elements.Add(new HttpsTransportBindingElement
- {
- AuthenticationScheme = AuthenticationSchemes.Basic,
- HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
- BypassProxyOnLocal = false,
- KeepAliveEnabled = false,
- ProxyAuthenticationScheme = AuthenticationSchemes.Basic,
- Realm = "XISOAPApps",
- UseDefaultWebProxy = true,
- MaxReceivedMessageSize = 9999999
- });
- var scSvc = new VesselSchedule_OutClient
- (new CustomBinding(binding),
- new EndpointAddress("https://webmethods.eimskip.net/ws/EIShippingSchedule.wsd.ShippingSchedule/HTTPS_Port"));
- scSvc.ClientCredentials.UserName.UserName = "***";
- scSvc.ClientCredentials.UserName.Password = "***";
- return scSvc;
- }
- private VesselSchedule_OutClient GetSvc2()
- {
- var binding = new CustomBinding();
- var tmb = new TextMessageEncodingBindingElement
- {
- //MaxReadPoolSize = 64,
- //MaxWritePoolSize = 16,
- //WriteEncoding = Encoding.UTF8,
- MessageVersion = MessageVersion.Soap11,
- //ReaderQuotas =
- //{
- // MaxDepth = 10000000,
- // MaxStringContentLength = 10000000,
- // MaxArrayLength = 67108864,
- // MaxBytesPerRead = 65536,
- // MaxNameTableCharCount = 100000
- //}
- };
- binding.Elements.Add(tmb);
- binding.Elements.Add(new HttpsTransportBindingElement
- {
- AuthenticationScheme = AuthenticationSchemes.Basic,
- //HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
- //BypassProxyOnLocal = false,
- //KeepAliveEnabled = false,
- //ProxyAuthenticationScheme = AuthenticationSchemes.Basic,
- //Realm = "XISOAPApps",
- //UseDefaultWebProxy = true,
- //MaxReceivedMessageSize = 9999999
- });
- var scSvc = new VesselSchedule_OutClient
- (new CustomBinding(binding),
- new EndpointAddress("https://webmethods.eimskip.net/ws/EIShippingSchedule.wsd.ShippingSchedule/HTTPS_Port"));
- scSvc.ClientCredentials.UserName.UserName = "***";
- scSvc.ClientCredentials.UserName.Password = "***";
- return scSvc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement