Examples of SDKException


Examples of com.ebay.sdk.SdkException

    if(foundVersion || foundAllVersion) {
      try {
        File csFile = new File(ATTR_XML_FILE_NAME);
        csXml = XmlUtil.createDom(csFile);
      } catch(IOException ioe) {
        throw new SdkException("Error processing file: " + ATTR_XML_FILE_NAME + " : " + ioe.getMessage());
      } catch(SAXException se) {
        throw new SdkException("Error processing file: " + ATTR_XML_FILE_NAME + " : " + se.getMessage());
      } catch(ParserConfigurationException pce) {
        throw new SdkException("Error processing file: " + ATTR_XML_FILE_NAME + " : " + pce.getMessage());
        }
      } else {
        int[] attrSetIds = null;
        if(asList != null) {
          attrSetIds = new int[asList.length];
View Full Code Here

Examples of com.ebay.sdk.SdkException

    String catID;
    for(i = 0; i < categories.length; i++ ) {
      CategoryType cat = categories[i];
      catID = cat.getCategoryID();
      if( catID == null ) {
        throw new SdkException("Category ID is not set for the category.");
      }

      CharacteristicsSetType[] sets = cat.getCharacteristicsSets();
      if( sets == null || sets.length == 0 ) {
        throw new SdkException("CharacteristicsSet is not set for the category.");
      }
        csID = sets[0].getAttributeSetID();

    ExtendedProductFinderIDType[] prodFinders = cat.getProductFinderIDs();
    if(prodFinders != null && prodFinders.length > 0) {
View Full Code Here

Examples of com.ebay.sdk.SdkException

    {
      String cat_pf = ((String[])obj)[0];

      String[] delim = cat_pf.split("_");
      if( delim == null || delim.length != 2 ) {
        throw new SdkException("Invalid PF_ID_TAG tag found in the query string array.");
      }
      String pfID = delim[0];
      String catID = delim[0];
      int csID = Integer.parseInt(delim[1]);
View Full Code Here

Examples of com.ebay.sdk.SdkException

      SearchAttributeSet set = sets[i];
      CategoryType cat = findCategoryByProductFinderID(cats, set.getProductFinderID());
//      CategoryType cat = cats[0];

      if( cat == null ) {
        throw new SdkException("findCategoryByProductFinderID failed.");
      }
      set.setCategoryID(Integer.parseInt(cat.getCategoryID()));
      //set.setCategoryOrdinal(i);
//     set.setProductFinderID(cat.getProductFinderID().intValue());
View Full Code Here

Examples of com.ebay.sdk.SdkException

        for(int i = 0; i < productFinderIDList.length; i++) {
          ids.append(productFinderIDList[i]).append(",");
        }
         int lastComaPos = ids.lastIndexOf(",");
         ids.deleteCharAt(lastComaPos);
         throw new SdkException("ProductFinder Data not available for product finder ids:" + ids.toString());
      }
      doc = XmlUtil.createDom(pfXml);

      //
      cache.put(productFinderIDList, doc);
View Full Code Here

Examples of com.ebay.sdk.SdkException

    throws SdkException, Exception
  {
    int i;
    java.util.Map gkey_pfid = getPFIDList(request);
    if( gkey_pfid.size() == 0 )
      throw new SdkException("No product finder post data were found.");

    Object[] rgPFID = gkey_pfid.values().toArray();

    //
    SearchAttributeSet[] sets = new SearchAttributeSet[gkey_pfid.size()];
    for( i = 0; i < sets.length; i++ )
    {
      sets[i] = new SearchAttributeSet();
      sets[i].setProductFinderID(Integer.parseInt((String)rgPFID[i]));
    }

    //
    Object[] keys = request.keySet().toArray();
    for(i = 0; i < keys.length; i++ )
    {
      String key = (String) keys[i];

      if (!key.startsWith(A))
        continue;

      String skey = key.substring(A.length());
      String aid, groupKey;
      int us_idx = skey.indexOf(US);
      if( us_idx != -1 )
      {
        aid = skey.substring(0, us_idx);
        groupKey = skey.substring(us_idx);
      }
      else
      {
        aid = skey;
        groupKey = "";
      }

      String valStr = ((String[])request.get(key))[0];

      Object objPFID = findValueByStringKey(gkey_pfid, groupKey);
      if( objPFID == null )
        throw new SdkException("Invalid group key.");

      SearchAttributeSet set = findAttributeSetByPFID(sets, Integer.parseInt((String)objPFID));
      SearchAttribute attr = new SearchAttribute();
      attr.setAttributeID(Integer.parseInt(aid));
      Value val = new Value();
View Full Code Here

Examples of com.ebay.sdk.SdkException

              cats = mappedArray.getCategory();
            }
            siteWideCharacteristicSets = resp.getSiteWideCharacteristicSets();
          }
        } catch(IOException ioe) {
          throw new SdkException("Error processing file: " + CATCS_FILE_NAME + " : " + ioe.getMessage());
        } catch(ClassNotFoundException cnfe) {
          throw new SdkException("Error processing file: " + CATCS_FILE_NAME + " : " + cnfe.getMessage());
        } catch(ClassCastException cce) {
          throw new SdkException("Error processing file: " + CATCS_FILE_NAME + " : " + cce.getMessage());
        }
      } else {
        downloadCategoryCS(catId);
        writeObjectToDisk(resp);
      }
View Full Code Here

Examples of com.ebay.sdk.SdkException

    {     
      FetchTokenCall api = new FetchTokenCall(this.apiContext);

      String s = this.txtSessionID.getText();
      if( s.length() == 0 )
        throw new SdkException("Please get SessionID first.");
      api.setSessionID(s);

      this.generatedToken = api.fetchToken();

      this.txtToken.setText(this.generatedToken);
View Full Code Here

Examples of com.ebay.sdk.SdkException

  void getSessionID()
  {
      try {
       
        if (!validateApiAccount()) {
        throw new SdkException("Please fill in Api Account first.");
      }
       
      GetSessionIDCall api = new GetSessionIDCall(this.apiContext);
     
      String runame = this.getRuName();
View Full Code Here

Examples of com.ebay.sdk.SdkException

  private void addAuthToken(Document doc) throws SdkException{
    Node node = XmlUtil.getChildByName(doc, "UploadSiteHostedPicturesRequest");
    Node requesterCredentials = XmlUtil.appendChildNode(doc, EBAY_NAMESPACE, node, "RequesterCredentials");
    String tokenString = apiContext.getApiCredential().geteBayToken();
    if(tokenString == null || tokenString.length() == 0){
      throw new SdkException("No Token Found!!!");
    } else {
      XmlUtil.appendChildNode(doc, requesterCredentials, "eBayAuthToken", tokenString);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.