public void GetAttributesCS() { GetAttributesCSCall api = new GetAttributesCSCall(this.apiContext); // Return version number only. DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnSummary }; api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels); // Make API call. String csXml = api.GetAttributesCS(); //check whether the call is success. Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning,"the call is failure!"); Assert.IsNull(csXml); Assert.IsNotNull(api.AttributeVersionResult); int ver = Int32.Parse(api.AttributeVersionResult); Assert.IsTrue(ver > 0); }
/// <summary> /// Get CS xml data by calling eBay API. /// </summary> /// <param name="asn">The <c>ApiContext</c> object to make API call.</param> public XmlDocument DownloadXml(ApiContext asn) { this.apiContext = asn; // GetAttributesCSCall api = new GetAttributesCSCall(asn); //api.ErrorLevel = ErrorLevelEnum.BothShortAndLongErrorStrings; api.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); api.Timeout = 480000; string csXml = XmlDeclaration + "\n" + api.GetAttributesCS(); // Apply style XSL. string xslText = GetDefaultStyleXsl(); string fixedXml = FixAttributesXml(csXml, xslText); XmlDocument xml = new XmlDocument(); xml.LoadXml(fixedXml); mXml = xml; return mXml; }
private string getCurrentAttributeSystemVersion() { GetAttributesCSCall api = new GetAttributesCSCall(apiContext); api.DetailLevelList.Add(DetailLevelCodeType.ReturnSummary); return api.GetAttributesCSVersion(); }
private void BtnGetAttributesCS_Click(object sender, System.EventArgs e) { try { TxtAttributeData.Text = ""; GetAttributesCSCall apicall = new GetAttributesCSCall(Context); apicall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); if (TxtAttVersion.Text.Length > 0) apicall.AttributeVersion = TxtAttVersion.Text; if (TxtAttSets.Text.Length > 0) { apicall.AttributeSetIDList = new Int32Collection(); string[] atts = TxtAttSets.Text.Split(','); foreach (string att in atts) apicall.AttributeSetIDList.Add(Convert.ToInt32(att)); } string attdata = apicall.GetAttributesCS(); TxtAttributeData.Text = attdata.Replace("\n", "\r\n"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }