Examples of FaultException


Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

            Object resp = invokeTarget(msg);
          
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

   private static URI getDialect( TopicExpressionType topicExprElem )
   {
      if ( !topicExprElem.isSetDialect(  ) )
      {
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   "The Dialect attribute is required by the WS-BaseNotification TopicExpressionType." );
      }

      try
      {
         return new URI( topicExprElem.getDialect(  ) );
      }
      catch ( URISyntaxException urise )
      {
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   "The Dialect attribute of the WS-BaseNotification TopicExpressionType must be a valid URI." );
      }
   }
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

         return topicSpaceSet.evaluateTopicExpression( m_topicExpression );
      }
      catch ( TopicExpressionException e )
      {
         LOG.debug( "Failed to evaluate TopicExpression.", e );
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   "An exception occurred evaluating the topic expression. " );
      }
   }
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

            XmlObject[] childElems = XmlBeanUtils.getChildElements( body.getXmlObject() );
            Method serviceMethod = null;

            if ( childElems.length > 1 )
            {
                throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                        "SOAP request Body contains more than one body element - this service requires that all SOAP requests contain at most one body element." );
            }
            // TODO: refactor below if-else - too much code duplication
            if ( childElems.length == 0 // empty Body
            {
                if ( methodNameFromAction != null )
                {
                    // try to find a method based on the wsa:Action...
                    serviceMethod = getServiceMethod( service, methodNameFromAction );
                    LOG.debug( MSG.getMessage( Keys.INVOKE_RESOURCE_METHOD,
                            serviceMethod.getName() ) );
                    XmlObject responseXBean = invokeServiceMethod( serviceMethod, service, null, serviceClass );
                    if ( responseXBean != null )
                    {
                        responseBodyElems.add( responseXBean );
                    }
                }
                else // empty Body and unmapped wsa:Action
                {
                    throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                            "No SOAP Body elements were defined, and the value of the WS-Addressing Action header was not recognized - unable to dispatch request." );
                }
            }
            else    // childElems.length == 1
            {
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

                    strBuf.append( ") " );
                    strBuf.append( errorList.get( i ) );
                    strBuf.append( "\n" );
                }
                strBuf.append( "\n" );
                throw new FaultException( Soap1_1Constants.FAULT_CLIENT, strBuf.toString() );
            }
        }
    }
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

            if ( LOG.isDebugEnabled() )
            {
                LOG.debug( MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
                e.printStackTrace();
            }
            throw new FaultException( Soap1_1Constants.FAULT_SERVER, MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
        }
    }
View Full Code Here

Examples of org.apache.ws.resource.faults.FaultException

            }
        }
        if ( serviceMethod == null // method not found
        {
            QName bodyElemName = XmlBeanUtils.getName( param );
            throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                    MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT, toString( bodyElemName ) ) );
        }
        LOG.debug( MSG.getMessage( Keys.FOUND_SERVICE_METHOD, serviceMethod.getName() ) );
        return serviceMethod;
    }
View Full Code Here

Examples of org.fcrepo.common.FaultException

                }
            }
        } catch (ValidationException e) {
            throw e;
        } catch (ServerException e) {
            throw new FaultException(e);
        }
    }
View Full Code Here

Examples of org.servicemix.jbi.FaultException

    }

    protected void fail(MessageExchange exchange, Exception error) throws MessagingException {
        exchange.setError(error);
        if (error instanceof FaultException) {
            FaultException faultException = (FaultException) error;
            exchange.setFault(faultException.getFault());
        }
        exchange.setStatus(ExchangeStatus.ERROR);
        getDeliveryChannel().send(exchange);
    }
View Full Code Here

Examples of org.servicemix.jbi.FaultException

            validator.validate(src, result);
            if (errorHandler.hasErrors()) {
                Fault fault = exchange.createFault();
                fault.setProperty("org.servicemix.schema", schema);
                fault.setContent(new DOMSource(result.getNode(), result.getSystemId()));
                throw new FaultException("Failed to validate against schema: " + schema, exchange, fault);
            }
            else {
              // Retrieve the ouput of the validation
              // as it may have been changed by the validator
              out.setContent(new DOMSource(result.getNode(), result.getSystemId()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.