/// <summary> /// Initializes the services of MS-WEBSS with the specified transport type, soap version and user authentication provided by the test case. /// </summary> /// <param name="transportType">The type of the connection</param> /// <param name="soapVersion">The soap version of the protocol message</param> /// <param name="userAuthentication">a user authenticated</param> /// <param name="serverRelativeUrl"> a Server related URL</param> public void InitializeService(TransportProtocol transportType, SoapProtocolVersion soapVersion, UserAuthentication userAuthentication, string serverRelativeUrl) { this.service = Proxy.CreateProxy <WebsSoap>(this.Site); this.service.SoapVersion = soapVersion; // select transport protocol switch (transportType) { case TransportProtocol.HTTP: this.service.Url = serverRelativeUrl; break; default: this.service.Url = serverRelativeUrl; // when request URL include HTTPS prefix, avoid closing base connection. // local client will accept all certificate after execute this function. Common.AcceptServerCertificate(); break; } this.service.Credentials = AdapterHelper.ConfigureCredential(userAuthentication); // Configure the service timeout. int soapTimeOut = Common.GetConfigurationPropertyValue <int>("ServiceTimeOut", this.Site); // 60000 means the configure SOAP Timeout is in minute. this.service.Timeout = soapTimeOut * 60000; }
/// <summary> /// Initializes the services of MS-WEBSS with the specified transport type, soap version and user authentication provided by the test case. /// </summary> /// <param name="transportType">The type of the connection</param> /// <param name="soapVersion">The soap version of the protocol message</param> /// <param name="userAuthentication">a user authenticated</param> /// <param name="serverRelativeUrl"> a Server related URL</param> public void InitializeService(TransportProtocol transportType, SoapProtocolVersion soapVersion, UserAuthentication userAuthentication, string serverRelativeUrl) { this.service = Proxy.CreateProxy<WebsSoap>(this.Site); this.service.SoapVersion = soapVersion; // select transport protocol switch (transportType) { case TransportProtocol.HTTP: this.service.Url = serverRelativeUrl; break; default: this.service.Url = serverRelativeUrl; // when request URL include HTTPS prefix, avoid closing base connection. // local client will accept all certificate after execute this function. Common.AcceptServerCertificate(); break; } this.service.Credentials = AdapterHelper.ConfigureCredential(userAuthentication); // Configure the service timeout. int soapTimeOut = Common.GetConfigurationPropertyValue<int>("ServiceTimeOut", this.Site); // 60000 means the configure SOAP Timeout is in minute. this.service.Timeout = soapTimeOut * 60000; }