Example usage for javax.xml.ws WebServiceException getMessage

List of usage examples for javax.xml.ws WebServiceException getMessage

Introduction

In this page you can find the example usage for javax.xml.ws WebServiceException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.clustercontrol.infra.util.InfraEndpointWrapper.java

public void modifyInfraManagement(InfraManagementInfo info) throws HinemosUnknown_Exception,
        InvalidRole_Exception, InvalidUserPass_Exception, InvalidSetting_Exception, NotifyDuplicate_Exception,
        NotifyNotFound_Exception, InfraManagementNotFound_Exception, InfraManagementDuplicate_Exception {
    WebServiceException wse = null;
    for (EndpointSetting<InfraEndpoint> endpointSetting : getInfraEndpoint(endpointUnit)) {
        try {//from  ww w  .j av a  2  s  .  c o  m
            InfraEndpoint endpoint = endpointSetting.getEndpoint();
            endpoint.modifyInfraManagement(info);
            return;
        } catch (WebServiceException e) {
            wse = e;
            m_log.warn("modifyInfraManagement(), " + e.getMessage());
            endpointUnit.changeEndpoint();
        }
    }
    throw wse;
}

From source file:com.clustercontrol.infra.util.InfraEndpointWrapper.java

public void deleteInfraManagement(List<String> managementIds)
        throws HinemosUnknown_Exception, InvalidRole_Exception, InvalidUserPass_Exception,
        NotifyNotFound_Exception, InfraManagementNotFound_Exception {
    WebServiceException wse = null;
    for (EndpointSetting<InfraEndpoint> endpointSetting : getInfraEndpoint(endpointUnit)) {
        try {/*from  w w  w.j  av  a  2s.  c  om*/
            InfraEndpoint endpoint = (InfraEndpoint) endpointSetting.getEndpoint();
            endpoint.deleteInfraManagement(managementIds);
            return;
        } catch (WebServiceException e) {
            wse = e;
            m_log.warn("deleteInfraManagement(), " + e.getMessage());
            endpointUnit.changeEndpoint();
        }
    }
    throw wse;
}

From source file:com.clustercontrol.infra.util.InfraEndpointWrapper.java

public List<InfraManagementInfo> getInfraManagementListByOwnerRole(String ownerRoleId)
        throws HinemosUnknown_Exception, InvalidRole_Exception, InvalidUserPass_Exception,
        NotifyNotFound_Exception {
    WebServiceException wse = null;
    for (EndpointSetting<InfraEndpoint> endpointSetting : getInfraEndpoint(endpointUnit)) {
        try {/*from  w w w  .  j av  a2  s . c o  m*/
            InfraEndpoint endpoint = (InfraEndpoint) endpointSetting.getEndpoint();
            List<InfraManagementInfo> list = endpoint.getInfraManagementListByOwnerRole(ownerRoleId);
            return list;
        } catch (WebServiceException e) {
            wse = e;
            m_log.warn("getInfraManagementList(), " + e.getMessage());
            endpointUnit.changeEndpoint();
        }
    }
    throw wse;
}

From source file:com.clustercontrol.infra.util.InfraEndpointWrapper.java

public List<InfraFileInfo> getInfraFileListByOwnerRoleId(String ownerRoleId)
        throws HinemosUnknown_Exception, InvalidRole_Exception, InvalidUserPass_Exception {
    WebServiceException wse = null;
    for (EndpointSetting<InfraEndpoint> endpointSetting : getInfraEndpoint(endpointUnit)) {
        try {/* w w w  .j a  va 2s.  co m*/
            InfraEndpoint endpoint = endpointSetting.getEndpoint();
            List<InfraFileInfo> list = endpoint.getInfraFileListByOwnerRoleId(ownerRoleId);
            return list;
        } catch (WebServiceException e) {
            wse = e;
            m_log.warn("getInfraFileListByOwnerRoleId(), " + e.getMessage());
            endpointUnit.changeEndpoint();
        }
    }
    throw wse;
}

From source file:Java_BWS_Sample.SampleBwsClient.java

/*******************************************************************************************************************
 *
 * Call _bwsService.getSystemInfo() and display the returned properties.
 *
 * @return Returns true if getSystemInfo is successful, and false otherwise.
 *
 *******************************************************************************************************************
 *///from  www .j  av a  2 s  .  c o m
public static boolean getSystemInfo() {
    final String METHOD_NAME = "getSystemInfo()";
    final String BWS_API_NAME = "_bws.getSystemInfo()";

    logMessage("Entering %s", METHOD_NAME);
    boolean returnValue = false;

    GetSystemInfoRequest request = new GetSystemInfoRequest();

    /*
     * Setting the value of loadAuthenticatedUserProperties to true will cause the API to return additional
     * properties about the current user, like the Authenticated User Uid property. The Authenticated User Uid
     * property is often used to make calls to APIs like getUsersDetail(), assignSWConfigsToGroup() and
     * others.
     *
     * Valid for BlackBerry Enterprise Server 5.0.3 MR5 or later
     */
    request.setLoadAuthenticatedUserProperties(true);
    request.setMetadata(REQUEST_METADATA);

    GetSystemInfoResponse response = null;

    /*
     * The try catch block here is used to illustrate how to handle a specific type of exception.
     * For example, in this case we check to see if the error was caused by invalid credentials.
     */
    try {
        logRequest(BWS_API_NAME);
        response = _bws.getSystemInfo(request);
        logResponse(BWS_API_NAME, response.getReturnStatus().getCode(), response.getMetadata());
    } catch (WebServiceException e) {
        if (e.getCause() instanceof HTTPException) {
            HTTPException httpException = (HTTPException) e.getCause();
            // Handle authentication failure.
            if (httpException != null
                    && httpException.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
                logMessage("Failed to authenticate with the BWS web service");
                logMessage("Exiting %s with value \"%s\"", METHOD_NAME, returnValue);
                return returnValue;
            }
        }

        // Log and re-throw exception.
        logMessage("Exiting %s with exception \"%s\"", METHOD_NAME, e.getMessage());
        throw e;

    }

    if (response.getReturnStatus().getCode().equals("SUCCESS")) {
        if (response.getProperties() != null && !response.getProperties().isEmpty()) {
            logMessage("%s returned the following properties:", BWS_API_NAME);
            for (Property property : response.getProperties()) {
                displayResult("%s: %s", property.getName(), property.getValue());
            }

            returnValue = true;
        } else {
            logMessage("No properties in response");
        }
    } else {
        System.err.format("Error: Code: \"%s\", Message: \"%s\"%n", response.getReturnStatus().getCode(),
                response.getReturnStatus().getMessage());
    }

    logMessage("Exiting %s with value \"%s\"", METHOD_NAME, returnValue);
    return returnValue;
}

From source file:com.omertron.thetvdbapi.TheTVDBApi.java

/**
 * Get a list of actors from the series id
 *
 * @param seriesId//  w  w  w .ja va 2 s  .  c  o m
 * @return
 */
public List<Actor> getActors(String seriesId) {
    StringBuilder urlBuilder = new StringBuilder();
    try {
        urlBuilder.append(getXmlMirror(apiKey));
        urlBuilder.append(apiKey);
        urlBuilder.append(SERIES_URL);
        urlBuilder.append(seriesId);
        urlBuilder.append("/actors.xml");
    } catch (WebServiceException ex) {
        LOG.warn(ex.getMessage(), ex);
        return new ArrayList<Actor>();
    }

    LOG.trace(URL, urlBuilder.toString());
    return TvdbParser.getActors(urlBuilder.toString(), getBannerMirror(apiKey));
}

From source file:com.omertron.thetvdbapi.TheTVDBApi.java

/**
 * Get all the episodes from a specific season for a series. Note: This
 * could be a lot of records/*  ww w.  ja v  a2 s  .  c  om*/
 *
 * @param id
 * @param season
 * @param language
 * @return
 */
public List<Episode> getSeasonEpisodes(String id, int season, String language) {
    StringBuilder urlBuilder = new StringBuilder();
    try {
        urlBuilder.append(getXmlMirror(apiKey));
        urlBuilder.append(apiKey);
        urlBuilder.append(SERIES_URL);
        urlBuilder.append(id);
        urlBuilder.append(ALL_URL);
        if (language != null) {
            urlBuilder.append(language).append(XML_EXTENSION);
        }
    } catch (WebServiceException ex) {
        LOG.warn(ex.getMessage(), ex);
        return Collections.emptyList();
    }

    LOG.trace(URL, urlBuilder.toString());
    return TvdbParser.getAllEpisodes(urlBuilder.toString(), season, getBannerMirror(apiKey));
}

From source file:com.omertron.thetvdbapi.TheTVDBApi.java

/**
 * Get a specific absolute episode's information
 *
 * @param seriesId/*from  ww w. java2 s .  c  o  m*/
 * @param episodeNbr
 * @param language
 * @return
 */
public Episode getAbsoluteEpisode(String seriesId, int episodeNbr, String language) {
    StringBuilder urlBuilder = new StringBuilder();
    try {
        urlBuilder.append(getXmlMirror(apiKey));
        urlBuilder.append(apiKey);
        urlBuilder.append(SERIES_URL);
        urlBuilder.append(seriesId);
        urlBuilder.append("/absolute/");
        urlBuilder.append(episodeNbr);
        urlBuilder.append("/");
        if (language != null) {
            urlBuilder.append(language).append(XML_EXTENSION);
        }
    } catch (WebServiceException ex) {
        LOG.warn(ex.getMessage(), ex);
        return new Episode();
    }

    LOG.trace(URL, urlBuilder.toString());
    return TvdbParser.getEpisode(urlBuilder.toString(), getBannerMirror(apiKey));
}

From source file:com.omertron.thetvdbapi.TheTVDBApi.java

public Banners getBanners(String seriesId) {
    StringBuilder urlBuilder = new StringBuilder();
    try {//from w ww  .ja  va2  s  . c  o  m
        urlBuilder.append(getXmlMirror(apiKey));
        urlBuilder.append(apiKey);
        urlBuilder.append(SERIES_URL);
        urlBuilder.append(seriesId);
        urlBuilder.append("/banners.xml");
    } catch (WebServiceException ex) {
        LOG.warn(ex.getMessage(), ex);
        return new Banners();
    }

    LOG.trace(URL, urlBuilder.toString());
    Banners b = TvdbParser.getBanners(urlBuilder.toString(), getBannerMirror(apiKey));

    if (b != null) {
        b.setSeriesId(NumberUtils.toInt(seriesId));
    }

    return b;
}

From source file:com.omertron.thetvdbapi.TheTVDBApi.java

/**
 * Get information for a specific episode
 *
 * @param episodeId//from ww  w  .  ja  va  2 s.co  m
 * @param language
 * @return
 */
public Episode getEpisodeById(String episodeId, String language) {
    StringBuilder urlBuilder = new StringBuilder();

    try {
        urlBuilder.append(getXmlMirror(apiKey));
        urlBuilder.append(apiKey);
        urlBuilder.append("/episodes/");
        urlBuilder.append(episodeId);
        urlBuilder.append("/");
        if (StringUtils.isNotBlank(language)) {
            urlBuilder.append(language);
            urlBuilder.append(XML_EXTENSION);
        }
    } catch (WebServiceException ex) {
        LOG.warn(ex.getMessage(), ex);
        return new Episode();
    }

    LOG.trace(URL, urlBuilder.toString());
    return TvdbParser.getEpisode(urlBuilder.toString(), getBannerMirror(apiKey));
}