Package org.apache.ws.resource.faults

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


         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

            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

                    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

            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

            }
        }
        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

            org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics(getResourcePropertySet(), getTopicSpaceSet());
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw new FaultException(Soap1_1Constants.FAULT_SERVER, "Unable to init the ResourceProperty Changed topics. Cause: " + e.getLocalizedMessage());
        }

        /**
         * Initializes the Topic, TopicExpressionDialects and FixedTopicSet resource properties
         *
 
View Full Code Here

            /** END RESOURCE PROPERTIES **/

        }
        catch (Exception e)
        {
            throw new FaultException(Soap1_1Constants.FAULT_SERVER, "There was a problem in initializing resource properties.  Cause: " + e.getLocalizedMessage());
        }
        // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet is implemented by the framework.
        // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic is implemented by the framework.
        // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects is implemented by the framework.

View Full Code Here

         throw new org.apache.ws.resource.properties.faults.ResourceUnknownFaultException( getNamespaceSet(  ),
                                                                                           rue );
      }
      catch ( ResourceException re )
      {
         throw new FaultException( Soap1_1Constants.FAULT_SERVER, "Internal server error." );
      }
   }
View Full Code Here

      AddressingHeaders addrHeaders =
         (AddressingHeaders) msgContext.getProperty( org.apache.axis.message.addressing.Constants.ENV_ADDRESSING_REQUEST_HEADERS );
      if ( addrHeaders == null )
      {
         LOG.debug( MSG.getMessage( Keys.NO_WSA_HEADERS ) );
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT, "This endpoint requires WS-Addressing headers." );
      }

      Action wsaAction = addrHeaders.getAction(  );
      if ( wsaAction == null )
      {
         LOG.debug( MSG.getMessage( Keys.NO_WSA_ACTION ) );
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   "The WS-Addressing Action header is required by this endpoint." );
      }

      LOG.debug( MSG.getMessage( Keys.GET_ACTION_FROM_ADDR_HDR, wsaAction ) );
      return wsaAction.toString(  );
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.faults.FaultException

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.