GetSoapProtoclVersionByCurrentSetting() public static method

A method is used to get SOAP version for proxy class. It is used to for "SoapVersion" property of proxy class.
public static GetSoapProtoclVersionByCurrentSetting ( ) : SoapProtocolVersion
return SoapProtocolVersion
        /// <summary>
        /// Overrides the ManagedAdapterBase class' Initialize() method, it is used to initialize the adapter.
        /// </summary>
        /// <param name="testSite">A parameter represents the ITestSite instance, which is used to visit the test context.</param>
        public override void Initialize(ITestSite testSite)
        {
            base.Initialize(testSite);

            // Set the protocol name of current test suite
            Site.DefaultProtocolDocShortName = "MS-COPYS";

            TestSuiteManageHelper.Initialize(this.Site);

            // Merge the SHOULDMAY configuration file.
            Common.MergeSHOULDMAYConfig(this.Site);

            this.currentUser           = TestSuiteManageHelper.DefaultUser;
            this.domainOfCurrentUser   = TestSuiteManageHelper.DomainOfDefaultUser;
            this.passwordOfCurrentUser = TestSuiteManageHelper.PasswordOfDefaultUser;

            // Initialize the proxy class
            this.copySoapService = Proxy.CreateProxy <CopySoap>(this.Site, true, true, true);

            // Set service URL.
            this.copySoapService.Url = this.GetTargetServiceUrl(this.currentServiceLocation);

            // Set credential
            this.copySoapService.Credentials = TestSuiteManageHelper.DefaultUserCredential;

            // Set SOAP version
            this.copySoapService.SoapVersion = TestSuiteManageHelper.GetSoapProtoclVersionByCurrentSetting();

            // Accept Certificate
            TestSuiteManageHelper.AcceptServerCertificate();

            // set the service timeout.
            this.copySoapService.Timeout = TestSuiteManageHelper.CurrentSoapTimeOutValue;
        }
Example #2
0
        /// <summary>
        /// Initialize the adapter instance.
        /// </summary>
        /// <param name="testSite">A return value represents the ITestSite instance which contains the test context.</param>
        public override void Initialize(ITestSite testSite)
        {
            base.Initialize(testSite);
            TestSuiteManageHelper.Initialize(this.Site);
            TestSuiteManageHelper.AcceptServerCertificate();

            // Initial the listsws proxy without schema validation.
            if (null == this.listswsProxy)
            {
                this.listswsProxy = Proxy.CreateProxy <ListsSoap>(testSite, true, false, false);
            }

            FileUrlHelper.ValidateFileUrl(TestSuiteManageHelper.TargetServiceUrlOfMSCOPYS);

            // Point to listsws service according to the MS-COPYS service URL.
            string targetServiceUrl = Path.GetDirectoryName(TestSuiteManageHelper.TargetServiceUrlOfMSCOPYS);

            targetServiceUrl = Path.Combine(targetServiceUrl, @"lists.asmx");

            // Work around for local path format mapping to URL path format.
            targetServiceUrl = targetServiceUrl.Replace(@"\", @"/");
            targetServiceUrl = targetServiceUrl.Replace(@":/", @"://");

            // Setting the properties of listsws service proxy.
            this.listswsProxy.Url         = targetServiceUrl;
            this.listswsProxy.Credentials = TestSuiteManageHelper.DefaultUserCredential;
            this.listswsProxy.SoapVersion = TestSuiteManageHelper.GetSoapProtoclVersionByCurrentSetting();

            // 60000 means the configure SOAP Timeout is in minute.
            this.listswsProxy.Timeout = TestSuiteManageHelper.CurrentSoapTimeOutValue;
        }