Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * (c) Copyright IBM Corp 2001, 2006 
   */
  
  package javax.wsdl;
  
  public class WSDLException extends Exception
  {
    public static final long serialVersionUID = 1;
 
   public static final String INVALID_WSDL = "INVALID_WSDL";
   public static final String PARSER_ERROR = "PARSER_ERROR";
   public static final String OTHER_ERROR = "OTHER_ERROR";
   public static final String CONFIGURATION_ERROR = "CONFIGURATION_ERROR";
   public static final String UNBOUND_PREFIX = "UNBOUND_PREFIX";
   public static final String NO_PREFIX_SPECIFIED = "NO_PREFIX_SPECIFIED";
 
   private String faultCode = null;
   private Throwable targetThrowable = null;
   private String location = null;
 
   public WSDLException(String faultCodeString msgThrowable t)
   {
     super(msgt);
     setFaultCode(faultCode);    
   }
 
   public WSDLException(String faultCodeString msg)
   {
     this(faultCodemsgnull);
   }
 
   public void setFaultCode(String faultCode)
   {
     this. = faultCode;
   }
 
   public String getFaultCode()
   {
     return ;
   }
 
   public void setTargetException(Throwable targetThrowable)
   {
     this. = targetThrowable;
   }
 
   {
     if( == nullreturn getCause();
     else return ;
   }

  
Set the location using an XPath expression. Used for error messages.

Parameters:
location an XPath expression describing the location where the exception occurred.
 
   public void setLocation(String location)
   {
     this. = location;
   }

  
Get the location, if one was set. Should be an XPath expression which is used for error messages.
 
   public String getLocation()
   {
     return ;
   }
 
   public String getMessage()
   {
     StringBuffer strBuf = new StringBuffer();
 
     strBuf.append("WSDLException");
 
     if ( != null)
     {
       try
       {
         strBuf.append(" (at " +  + ")");
       }
       catch (IllegalArgumentException e)
       {
       }
     }
 
     if ( != null)
     {
       strBuf.append(": faultCode=" + );
     }
 
     String thisMsg = super.getMessage();
     String targetMsg = null;
     String targetName = null;
     if(getTargetException() != null)
    {
      targetMsg = getTargetException().getMessage();
      targetName = getTargetException().getClass().getName();
    }
    if (thisMsg != null
        && (targetMsg == null || !thisMsg.equals(targetMsg)))
    {
      strBuf.append(": " + thisMsg);
    }
    if (targetName != null)
    {
      strBuf.append(": " + targetName);
    }
    
    if (targetMsg != null)
    {
      strBuf.append(": " + targetMsg);
    }
    return strBuf.toString();
  }
New to GrepCode? Check out our FAQ X