Package javax.xml.ws.http

Examples of javax.xml.ws.http.HTTPException


            throw ce;
        } catch (Exception e) {
            String message = "Cannot initalize Web Services service object [" + serviceKey + "]: " + e.getMessage();

            if (e instanceof HTTPException) {
                HTTPException he = (HTTPException) e;
                if (he.getStatusCode() == 401) {
                    throw new CmisUnauthorizedException(message, e);
                } else if (he.getStatusCode() == 407) {
                    throw new CmisProxyAuthenticationException(message, e);
                }
            }

            throw new CmisConnectionException(message, e);
View Full Code Here


            }
            if (ex instanceof Fault && ex.getCause() instanceof IOException) {
                throw new WebServiceException(ex.getMessage(), ex.getCause());
            }
            if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(ex);
                throw exception;
            } else if (getBinding() instanceof SOAPBinding) {
                SOAPFault soapFault = createSoapFault((SOAPBinding)getBinding(), ex);
                if (soapFault == null) {
                    throw new WebServiceException(ex);
                }
                SOAPFaultException  exception = new SOAPFaultException(soapFault);
                if (ex instanceof Fault && ex.getCause() != null) {
                    exception.initCause(ex.getCause());
                } else {
                    exception.initCause(ex);
                }
                throw exception;               
            } else {
                throw new WebServiceException(ex);
            }
View Full Code Here

                        throw new SOAPFaultException(soapFault);
                    } catch (SOAPException e) {
                        throw new WebServiceException(e);
                    }
                } else if (getBinding() instanceof HTTPBinding) {
                    HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                    exception.initCause(exp);
                    throw exception;
                } else {
                    throw new WebServiceException(exp);
                }
            }
View Full Code Here

                    throw ex.fillInStackTrace();
                }
            }
           
            if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(ex);
                throw exception;
            } else if (getBinding() instanceof SOAPBinding) {
                SOAPFault soapFault = createSoapFault(ex);
                if (soapFault == null) {
                    throw new WebServiceException(ex);
                }
               
                SOAPFaultException  exception = new SOAPFaultException(soapFault);
                exception.initCause(ex);
                throw exception;               
            } else {
                throw new WebServiceException(ex);
            }
        } finally {
View Full Code Here

          buff.get(lastr, 0, lastr.length);
          out.write(lastr);
          out.close();
          resCode = httpConn.getResponseCode();
          if(resCode >= HttpURLConnection.HTTP_UNAUTHORIZED){//Stops here if Google doesn't like us/
            throw new HTTPException(HttpURLConnection.HTTP_UNAUTHORIZED);//Throws
          }
          String line;//Each line that is read back from Google.
          BufferedReader br =  new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
          while ((line = br.readLine( )) != null) {
            if(line.length()>19 && resCode > 100 && resCode < HttpURLConnection.HTTP_UNAUTHORIZED){
View Full Code Here

            }
            if (ex instanceof Fault && ex.getCause() instanceof IOException) {
                throw new WebServiceException(ex.getMessage(), ex.getCause());
            }
            if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(ex);
                throw exception;
            } else if (getBinding() instanceof SOAPBinding) {
                SOAPFault soapFault = createSoapFault((SOAPBinding)getBinding(), ex);
                if (soapFault == null) {
                    throw new WebServiceException(ex);
                }
                SOAPFaultException  exception = new SOAPFaultException(soapFault);
                if (ex instanceof Fault && ex.getCause() != null) {
                    exception.initCause(ex.getCause());
                } else {
                    exception.initCause(ex);
                }
                throw exception;               
            } else {
                throw new WebServiceException(ex);
            }
View Full Code Here

            }
            if (ex instanceof Fault && ex.getCause() instanceof IOException) {
                throw new WebServiceException(ex.getMessage(), ex.getCause());
            }
            if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(ex);
                throw exception;
            } else if (getBinding() instanceof SOAPBinding) {
                SOAPFault soapFault = createSoapFault((SOAPBinding)getBinding(), ex);
                if (soapFault == null) {
                    throw new WebServiceException(ex);
                }
                SOAPFaultException  exception = new SOAPFaultException(soapFault);
                if (ex instanceof Fault && ex.getCause() != null) {
                    exception.initCause(ex.getCause());
                } else {
                    exception.initCause(ex);
                }
                throw exception;               
            } else {
                throw new WebServiceException(ex);
            }
View Full Code Here

                }
                if (soapFault != null) {
                    throw new SOAPFaultException(soapFault);
                }
            } else if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(new Exception(error.toString()));
                throw exception;
            }
            throw new WebServiceException(error.toString());
        }
    }
View Full Code Here

        if (ex instanceof Fault && ex.getCause() instanceof IOException) {
            throw new WebServiceException(ex.getMessage(), ex.getCause());
        }
       
        if (getBinding() instanceof HTTPBinding) {
            HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
            exception.initCause(ex);
            return exception;
        } else if (getBinding() instanceof SOAPBinding) {
            SOAPFault soapFault = null;
            try {
                soapFault = JaxWsClientProxy.createSoapFault((SOAPBinding)getBinding(), ex);
            } catch (SOAPException e) {
                //ignore
            }
            if (soapFault == null) {
                return new WebServiceException(ex);
            }
           
            SOAPFaultException  exception = new SOAPFaultException(soapFault);
            exception.initCause(ex);
            return exception;               
        }
        return new WebServiceException(ex);
    }
View Full Code Here

                        throw ex;
                    } catch (SOAPException e) {
                        throw new WebServiceException(e);
                    }
                } else if (getBinding() instanceof HTTPBinding) {
                    HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                    exception.initCause(exp);
                    throw exception;
                } else {
                    throw new WebServiceException(exp);
                }
            }
View Full Code Here

TOP

Related Classes of javax.xml.ws.http.HTTPException

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.