Examples of ApiLogging


Examples of com.ebay.sdk.ApiLogging

       Map<String, Object> context = FastMap.newInstance();
       context.put("locale", locale);
       context.put("productStoreId", productStoreId);
       Map<String, Object> config = EbayHelper.buildEbayConfig(context, delegator);
       ApiCredential apiCredential = new ApiCredential();
       ApiLogging apiLogging = new ApiLogging();
       apiLogging.setEnableLogging(false);
       apiLogging.setLogExceptions(false);
       apiLogging.setLogSOAPMessages(false);

       String devID = (String)config.get("devId");
        String appID = (String)config.get("appID");
        String certID = (String)config.get("certID");
        String token = (String)config.get("token");
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

       Map<String, Object> context = FastMap.newInstance();
       context.put("locale", locale);
       context.put("productStoreId", productStoreId);
       Map<String, Object> config = EbayHelper.buildEbayConfig(context, delegator);
       ApiCredential apiCredential = new ApiCredential();
       ApiLogging apiLogging = new ApiLogging();
       apiLogging.setEnableLogging(false);
       apiLogging.setLogExceptions(false);
       apiLogging.setLogSOAPMessages(false);

       String devID = (String)config.get("devId");
        String appID = (String)config.get("appID");
        String certID = (String)config.get("certID");
        String token = (String)config.get("token");
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

       Map<String, Object> context = FastMap.newInstance();
       context.put("locale", locale);
       context.put("productStoreId", productStoreId);
       Map<String, Object> config = EbayHelper.buildEbayConfig(context, delegator);
       ApiCredential apiCredential = new ApiCredential();
       ApiLogging apiLogging = new ApiLogging();
       apiLogging.setEnableLogging(false);
       apiLogging.setLogExceptions(false);
       apiLogging.setLogSOAPMessages(false);

       String devID = (String)config.get("devId");
        String appID = (String)config.get("appID");
        String certID = (String)config.get("certID");
        String token = (String)config.get("token");
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

       Map<String, Object> context = FastMap.newInstance();
       context.put("locale", locale);
       context.put("productStoreId", productStoreId);
       Map<String, Object> config = EbayHelper.buildEbayConfig(context, delegator);
       ApiCredential apiCredential = new ApiCredential();
       ApiLogging apiLogging = new ApiLogging();
       apiLogging.setEnableLogging(false);
       apiLogging.setLogExceptions(false);
       apiLogging.setLogSOAPMessages(false);

       String devID = (String)config.get("devId");
        String appID = (String)config.get("appID");
        String certID = (String)config.get("certID");
        String token = (String)config.get("token");
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

          header = env.addHeader();
        }
        addSecurityHeader(header, apiContext, enableFullCredentials, needApiAccountOnly);
      } catch (SOAPException e) {
          //get ApiLogging
          ApiLogging apiLogging = apiContext.getApiLogging();
         
        if (apiLogging != null && apiLogging.isLogExceptions()) {
            //logging
          log.error(HANDLER_NAME + " : fail to add security headers.");
          log.error(e.getMessage());
        } else {
          e.printStackTrace();
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

       
  //This method supports only a URL, not a local file path. 
  public UploadSiteHostedPicturesResponseType uploadSiteHostedPictures(UploadSiteHostedPicturesRequestType request)
  {
      //get ApiLogging
        ApiLogging apiLogging = apiContext.getApiLogging();
       
        UploadSiteHostedPicturesResponseType response = null;
   
      try{
     
          //Convert the request object into XML Document
      Document doc = this.marshal(request);
         
          //Add eBay API token to the document
          addAuthToken(doc);
          if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
            String formattedReqXmlString = XmlUtil.getXmlStringFromDom(doc);
            logMessage("UploadSiteHostedPicturesRequest", formattedReqXmlString);
          }
         
          //Convert XML Document to XML String
          String requestXml = xmlToString(doc);
         
       
          String responseXml=sendHttpRequest(requestXml);
         
            if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
                Document respDom = XmlUtil.createDom(responseXml);
                String formattedRespXmlString = XmlUtil.getXmlStringFromDom(respDom);
                logMessage("UploadSiteHostedPicturesResponse", formattedRespXmlString);
            }
           
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

     * for detailed error information.
     */
  public boolean UpLoadSiteHostedPicture(PictureInfo picInfo, UploadSiteHostedPicturesRequestType request) {
   
    //get ApiLogging
      ApiLogging apiLogging = apiContext.getApiLogging();
   
      try{
     
          //Serialize the request into the XML Document
      Document doc = this.marshal(request);
         
          //Add eBay API token to the document
          addAuthToken(doc);
          if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
            String formattedReqXmlString = XmlUtil.getXmlStringFromDom(doc);
            logMessage("UploadSiteHostedPicturesRequest", formattedReqXmlString);
          }
         
          //Convert XML Document to XML String
          String requestXmlString = xmlToString(doc);
         
          //Send file and get response string
          String respString = sendFile(picInfo.getPictureFilePath(), requestXmlString);
          if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
            Document respDom = XmlUtil.createDom(respString);
            String formattedRespXmlString = XmlUtil.getXmlStringFromDom(respDom);
            logMessage("UploadSiteHostedPicturesResponse", formattedRespXmlString);
          }
         
          //Deserialize the response String into UploadSiteHostedPicturesResponseType object
          UploadSiteHostedPicturesResponseType response = unmarshal(respString);
         
          //Update PictureInfo object
          picInfo.setReponse(response);
     
      //success case
          if ( response.getErrors() == null || response.getErrors().length == 0 ) {
        picInfo.setURL(response.getSiteHostedPictureDetails().getFullURL());
        return true;
      }
     
          //warning case
      if ( response.getErrors().length > 0 && response.getAck() == AckCodeType.WARNING) {
        picInfo.setURL(response.getSiteHostedPictureDetails().getFullURL());
       
        picInfo.setErrorType("PICTURE SERVICE RESPONSE WARNING");
        picInfo.setErrorMessage(response.getErrors()[0].getShortMessage());
       
          if (apiLogging != null && apiLogging.isLogExceptions()) {
            log.warn("PICTURE SERVICE RESPONSE WARNING");
            log.warn(response.getErrors()[0].getShortMessage());
          }
       
        return true;
      }
     
      //error case
      picInfo.setErrorType("PICTURE SERVICE RESPONSE ERROR");
      picInfo.setErrorMessage(response.getErrors()[0].getShortMessage());
     
        if (apiLogging != null && apiLogging.isLogExceptions()) {
          log.error("PICTURE SERVICE RESPONSE ERROR");
          log.error(response.getErrors()[0].getShortMessage());
        }
     
      return false;
    } catch (Exception e) {
      picInfo.setErrorType("PICTURE SERVICE UPLOAD ERROR");
      picInfo.setErrorMessage(e.getMessage());
     
        if (apiLogging != null && apiLogging.isLogExceptions()) {
          log.error("fail to upload picture to eBay picture server!");
          log.error(e.getMessage());
        }
       
      return false;
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

     
        //get ApiContext from SOAPMessageContext
        ApiContext apiContext = (ApiContext)smc.get(HandlerConstants.API_CONTEXT);
         
        //get ApiLogging
        ApiLogging apiLogging = apiContext.getApiLogging();
        // if http headers logging is not enabled, just return.
        if (apiLogging == null || !apiLogging.isLogHTTPHeaders()) {
          return true;     
        }
     
      Map http_req_headers = (Map) smc
          .get(MessageContext.HTTP_REQUEST_HEADERS);
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

    public boolean handleMessage(SOAPMessageContext smc) {
      //get ApiContext from SOAPMessageContext
      ApiContext apiContext = (ApiContext)smc.get(HandlerConstants.API_CONTEXT);
     
      //get ApiLogging
      ApiLogging apiLogging = apiContext.getApiLogging();
       
      //get xml string from SOAPMessageContext
        String xmlStr = null;
        try {
          SOAPMessage message = smc.getMessage();
          Source payload = message.getSOAPPart().getContent();
        xmlStr = XmlUtil.getXmlStringFromSource(payload);
      } catch (Exception e) {
        if (apiLogging != null && apiLogging.isLogExceptions()) {
          log.error(HANDLER_NAME + " : fail to get xml string from SOAP message");
          log.error(e.getMessage());
        } else {
          e.printStackTrace();
        }
        return true;
      }       
       
        Boolean request = (Boolean)
             smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
        if (request.booleanValue()) {//for request message
         
          apiContext.setRequestXml(xmlStr);
          if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
            logMessage("Request", xmlStr);
          }
         
        } else { //for response message
         
          apiContext.setResponseXml(xmlStr);
          if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
              logMessage("Response", xmlStr);          
          }
         
        }
    
View Full Code Here

Examples of com.ebay.sdk.ApiLogging

  public boolean handleFault(SOAPMessageContext smc) {
      //get ApiContext from SOAPMessageContext
      ApiContext apiContext = (ApiContext)smc.get(HandlerConstants.API_CONTEXT);
     
      //get ApiLogging
      ApiLogging apiLogging = apiContext.getApiLogging();
       
      //get xml string from SOAPMessageContext
        String xmlStr = null;
        try {
          SOAPMessage message = smc.getMessage();
          Source payload = message.getSOAPPart().getContent();
        xmlStr = XmlUtil.getXmlStringFromSource(payload);
      } catch (Exception e) {
        if (apiLogging != null && apiLogging.isLogExceptions()) {
          log.error(HANDLER_NAME + " : fail to get xml string from SOAP message");
          log.error(e.getMessage());
        } else {
          e.printStackTrace();
        }
        return true;
      }
     
      apiContext.setResponseXml(xmlStr);
      if (apiLogging != null && apiLogging.isLogSOAPMessages()) {
          logMessage("Response", xmlStr);          
      }
   
    return true;
   
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.