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.docdoku.client.data.MainModel.java

public String[] getTags() {
    String[] tags = mCache.getTags();

    if (tags == null) {
        try {/*from   w ww. j  av  a  2s .  c o m*/
            System.out.println("Retrieving tags");
            tags = mDocumentService.getTags(getWorkspace().getId());
            mCache.cacheTags(tags);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            showContinueOrExitDialog(message);
        }
    }
    return tags;
}

From source file:com.docdoku.client.data.MainModel.java

public DocumentMasterTemplate[] getDocMTemplates() {
    DocumentMasterTemplate[] templates = mCache.getDocMTemplates();

    if (templates == null) {
        try {//from ww w  .j a  va  2  s .com
            System.out.println("Retrieving templates");
            //templates = Tools.resetParentReferences(mDocumentService.getDocumentMasterTemplates(getWorkspace().getId()));
            templates = mDocumentService.getDocumentMasterTemplates(getWorkspace().getId());
            mCache.cacheDocMTemplates(templates);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            showContinueOrExitDialog(message);
        }
    }
    return templates;
}

From source file:com.docdoku.client.data.MainModel.java

public DocumentMaster getDocM(DocumentMasterKey pDocMPK) {
    DocumentMaster docM = mCache.getDocM(pDocMPK);

    if (docM == null) {
        try {//  ww  w . j ava  2 s .co  m
            System.out.println("Retrieving document master " + pDocMPK);
            docM = Tools.resetParentReferences(mDocumentService.getDocumentMaster(pDocMPK));
            mCache.cacheDocM(docM);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            JOptionPane.showMessageDialog(null, message, I18N.BUNDLE.getString("Error_title"),
                    JOptionPane.ERROR_MESSAGE);
        }
    }
    return docM;
}

From source file:com.docdoku.client.data.MainModel.java

public DocumentMaster[] getCheckedOutDocMs() {
    DocumentMaster[] docMs = mCache.getCheckedOutDocMs();

    if (docMs == null) {
        try {/*from ww  w.j  a  v a2s .c om*/
            System.out.println("Retrieving personnal checked out document masters");
            docMs = Tools.resetParentReferences(
                    mDocumentService.getCheckedOutDocumentMasters(getWorkspace().getId()));
            mCache.cacheCheckedOutDocMs(docMs);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            showContinueOrExitDialog(message);
        }
    }
    return docMs;
}

From source file:com.docdoku.client.data.MainModel.java

public DocumentMaster[] findDocMsByTag(String pTag) {
    DocumentMaster[] docMs = mCache.findDocMsByTag(pTag);

    if (docMs == null) {
        try {//from   ww  w.j a  va2s  . com
            System.out.println("Searching document masters by tag " + pTag);
            docMs = Tools.resetParentReferences(
                    mDocumentService.findDocumentMastersByTag(new TagKey(getWorkspace().getId(), pTag)));
            mCache.cacheDocMsByTag(pTag, docMs);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            showContinueOrExitDialog(message);
        }
    }
    return docMs;
}

From source file:com.docdoku.client.data.MainModel.java

public User getUser() {
    User user = mCache.getUser();/*w  w w .  j  a  v  a 2s . c  om*/

    if (user == null) {
        try {
            System.out.println("Retrieving personnal informations");
            user = mDocumentService.whoAmI(getWorkspace().getId());
            mCache.cacheUser(user);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            JOptionPane.showMessageDialog(null, message, I18N.BUNDLE.getString("Error_title"),
                    JOptionPane.ERROR_MESSAGE);
        }
    }
    return user;
}

From source file:com.docdoku.client.data.MainModel.java

public User[] getUsers() {
    User[] users = mCache.getUsers();/*  ww w  .  j av a 2  s.  c om*/

    if (users == null) {
        try {
            System.out.println("Retrieving users");
            users = mDocumentService.getUsers(getWorkspace().getId());
            mCache.cacheUsers(users);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            JOptionPane.showMessageDialog(null, message, I18N.BUNDLE.getString("Error_title"),
                    JOptionPane.ERROR_MESSAGE);
        }
    }
    return users;
}

From source file:com.docdoku.client.data.MainModel.java

public WorkflowModel getWorkflowModel(String pId) {
    WorkflowModel workflowModel = mCache.getWorkflowModel(pId);

    if (workflowModel == null) {
        try {/*from w ww.j  av a2 s  .c  o m*/
            System.out.println("Retrieving workflow model " + pId);
            workflowModel = Tools.resetParentReferences(
                    mWorkflowService.getWorkflowModel(new WorkflowModelKey(getWorkspace().getId(), pId)));
            mCache.cacheWorkflowModel(workflowModel);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            JOptionPane.showMessageDialog(null, message, I18N.BUNDLE.getString("Error_title"),
                    JOptionPane.ERROR_MESSAGE);
        }
    }
    return workflowModel;
}

From source file:com.docdoku.client.data.MainModel.java

public FolderTreeNode[] getFolderTreeNodes(FolderTreeNode pParent) {
    String completePath = pParent.getCompletePath();
    FolderTreeNode[] folderTreeNodes = mCache.getFolderTreeNodes(completePath);
    if (folderTreeNodes == null) {
        try {/*ww  w  .  ja  va 2s .  c  o m*/
            System.out.println("Retrieving folders in " + completePath);
            String[] folders = mDocumentService.getFolders(completePath);
            folderTreeNodes = new FolderTreeNode[folders.length];
            for (int i = 0; i < folderTreeNodes.length; i++) {
                folderTreeNodes[i] = new FolderTreeNode(completePath + "/" + folders[i], pParent);
            }

            mCache.cacheFolderTreeNodes(completePath, folderTreeNodes);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            showContinueOrExitDialog(message);
        }
    }
    return folderTreeNodes;
}

From source file:com.docdoku.client.data.MainModel.java

public DocumentMasterTemplate getDocMTemplate(String pId) {
    DocumentMasterTemplate template = mCache.getDocMTemplate(pId);

    if (template == null) {
        try {//  w  w  w  . j  a v a2s .co m
            System.out.println("Retrieving document template " + pId);

            //template = Tools.resetParentReferences(mDocumentService.getDocumentMasterTemplate(new DocumentMasterTemplateKey(getWorkspace().getId(), pId)));
            template = mDocumentService
                    .getDocumentMasterTemplate(new DocumentMasterTemplateKey(getWorkspace().getId(), pId));

            mCache.cacheDocMTemplate(template);
        } catch (WebServiceException pWSEx) {
            String message;
            Throwable t = pWSEx.getCause();
            if (t != null) {
                message = t.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : t.getMessage();
            } else {
                message = pWSEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                        : pWSEx.getMessage();
            }

            showContinueOrExitDialog(message);
        } catch (Exception pEx) {
            String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown")
                    : pEx.getMessage();
            JOptionPane.showMessageDialog(null, message, I18N.BUNDLE.getString("Error_title"),
                    JOptionPane.ERROR_MESSAGE);
        }
    }
    return template;
}