Package com.google.api.ads.common.lib.exception

Examples of com.google.api.ads.common.lib.exception.ServiceException


      usernameToken.setActor("");

      soapClientHandler.setHeader(soapClient, WSSE_NAMESPACE, "Security",
          usernameToken);
    } catch (SOAPException e) {
      throw new ServiceException("Could not set WSSE security header.", e);
    }
  }
View Full Code Here


      appNameToken.setActor("");

      soapClientHandler.setHeader(soapClient, namespace, "RequestHeader",
          appNameToken);
    } catch (SOAPException e) {
      throw new ServiceException("Could not set application name header.", e);
    }
  }
View Full Code Here

    C adsServiceClient = createServiceClient(soapClient, adsServiceDescriptor, adsSession);
    try {
      adsServiceClient.setEndpointAddress(adsServiceDescriptor.getEndpointAddress(adsSession
          .getEndpoint()));
    } catch (MalformedURLException e) {
      throw new ServiceException("Unexpected exception", e);
    }
    return adsServiceClient;
  }
View Full Code Here

          }
        }
      }
      return requestHeader;
    } catch (SOAPException e) {
      throw new ServiceException("Unexpected exception.", e);
    }
  }
View Full Code Here

      String namespace =
          dfpApiConfiguration.getNamespacePrefix() + "/"
              + dfpServiceDescriptor.getVersion();
      soapClientHandler.setHeader(soapClient, namespace, "RequestHeader", soapHeader);
    } catch (InstantiationException e) {
      throw new ServiceException("Unexpected exception.", e);
    } catch (IllegalAccessException e) {
      throw new ServiceException("Unexpected exception.", e);
    } catch (ClassNotFoundException e) {
      throw new ServiceException("Unexpected exception.", e);
    } catch (InvocationTargetException e) {
      throw new ServiceException("Unexpected exception.", e);
    } catch (IllegalArgumentException e) {
      throw new ServiceException("Unexpected exception.", e);
    } catch (SecurityException e) {
      throw new ServiceException("Unexpected exception.", e);
    }
  }
View Full Code Here

    Exception apiException = new Exception();
    when(soapClientHandler.invokeSoapCall(soapCall)).thenReturn(soapCallReturn);
    when(soapCallReturn.getException()).thenReturn(apiException);
    when(tokenExpirationDetector.isTokenExpiredException(apiException)).thenReturn(true);
    when(dfaServiceDescriptor.getInterfaceClass()).thenReturn((Class) getClass());
    doThrow(new ServiceException(null, null))
        .when(dfaHeaderHandler).setHeaders(soapClient, dfaSession, dfaServiceDescriptor);

    assertSame(soapCallReturn, dfaServiceClient.callSoapClient(soapCall));

    verify(soapClientHandler, times(1)).invokeSoapCall(soapCall);
View Full Code Here

          newElement.addTextNode(headerData.get(headerElementName).toString());
        }
      }
      return requestHeader;
    } catch (SOAPException e) {
      throw new ServiceException("Unexpected exception.", e);
    }
  }
View Full Code Here

      SOAPHeaderElement soapHeaderElement = new SOAPHeaderElement(qName);
      soapHeaderElement.setObjectValue(headerValue);
      soapHeaderElement.setActor(null);
      soapClient.setHeader(soapHeaderElement);
    } catch (SOAPException e) {
      throw new ServiceException("Could not set header.", e);
    }
  }
View Full Code Here

        Service locator = (Service) axisCompatibleService.getLocatorClass()
            .getConstructor(new Class[0]).newInstance(new Object[0]);
        return (Stub) locator.getClass().getMethod("getPort", Class.class)
            .invoke(locator, soapServiceDescriptor.getInterfaceClass());
      }
      throw new ServiceException("Service [" + soapServiceDescriptor +
          "] not compatible with Axis", null);
    } catch (SecurityException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (NoSuchMethodException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (IllegalArgumentException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (IllegalAccessException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (InvocationTargetException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (ClassNotFoundException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (InstantiationException e) {
      throw new ServiceException("Unexpected Exception.", e);
    }
  }
View Full Code Here

      Object headerValue) {
    if (headerValue instanceof SOAPElement) {
      getContextHandlerFromClient(soapClient).addHeader(namespace, headerName,
          (SOAPElement) headerValue);
    } else {
      throw new ServiceException("Unexpected SOAP header given for JAX-WS binding. Given "
          + "object of class \"" + headerValue.getClass().toString() + "\" but expecting "
          + "object of class \"" + SOAPElement.class + "\".", null);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.common.lib.exception.ServiceException

Copyright © 2018 www.massapicom. 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.