public void GetAttributesXSL()
 {
     GetAttributesXSLCall api = new GetAttributesXSLCall(this.apiContext);
     // Return version number only.
     DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
     DetailLevelCodeType.ReturnAll
     };
     api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
     // Make API call.
     XSLFileTypeCollection files = api.GetAttributesXSL();
     //check whether the call is success.
     Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning,"the call is failure!");
     Assert.IsNotNull(files);
     Assert.IsTrue(files.Count > 0);
     Assert.IsNotNull(files[0].FileName);
     Assert.IsNotNull(files[0].FileVersion);
     Assert.IsNotNull(files[0].FileContent);
 }
		private string getCurrentFileVersion() {
			GetAttributesXSLCall api = new GetAttributesXSLCall(apiContext);
			api.DetailLevelList.Add(DetailLevelCodeType.ReturnSummary);
			XSLFileTypeCollection xslFiles = api.GetAttributesXSL();
			string fileVersion = xslFiles[0].FileVersion;

			return fileVersion; 
		}
Beispiel #3
0
        private void BtnGetAttributesXSL_Click(object sender, System.EventArgs e)
        {
            try
            {
                GetAttributesXSLCall apicall = new GetAttributesXSLCall(Context);
                apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

                XSLFileTypeCollection attfiles = apicall.GetAttributesXSL();
                GetAttributesXSLCall.DecodeFileContent(attfiles[0]);
                TxtAttributeData.Text = attfiles[0].FileContent.Replace("\n", "\r\n");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
		/// <summary>
		/// Download XSL text from eBay by calling eBay API.
		/// </summary>
		/// <param name="asn">The <c>ApiContext</c> object to make API call.</param>
		public string DownloadXsl(ApiContext asn)
		{
			GetAttributesXSLCall api = new GetAttributesXSLCall(asn);
			api.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
			
			//api.ErrorLevel = ErrorLevelEnum.BothShortAndLongErrorStrings;
			//api.DetailLevel = 1;

			XSLFileTypeCollection xslFiles = api.GetAttributesXSL();
			
			if( xslFiles.Count > 0 )
			{
				GetAttributesXSLCall.DecodeFileContent(xslFiles[0]);
				this.mXslText = xslFiles[0].FileContent;
				this.mXslFileName = xslFiles[0].FileName;
			}
			else 
			{
				this.mXslText = null;
			}
			return mXslText;

		}