Package org.apache.ws.resource.faults

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


         SOAPHeader soapHeader          = context.getSOAPMessage(  ).getSOAPHeader(  );
         Iterator   resourceIdElemsIter =
            soapHeader.getChildElements( NameUtils.toName( getResourceIdentifierReferenceParameterQName(  ) ) );
         if ( !resourceIdElemsIter.hasNext(  ) )
         {
            throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                      "The expected resource identifier reference parameter named "
                                      + getResourceIdentifierReferenceParameterName(  )
                                      + " was not found in the SOAP header." );
         }

         SOAPHeaderElement resourceIdElem = (SOAPHeaderElement) resourceIdElemsIter.next(  );
         if ( resourceIdElemsIter.hasNext(  ) )
         {
            throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                      "More than one resource identifier reference parameter named "
                                      + getResourceIdentifierReferenceParameterName(  )
                                      + " was found in the SOAP header. Exactly one is expected." );
         }
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." );
         }

         XmlObject requestXBean;
         if ( childElems.length == 0 ) // empty Body
         {
            requestXBean = null;
            if ( methodNameFromAction != null )
            {
               // try to find a method based on the wsa:Action...
               serviceMethod = getServiceMethod( service, methodNameFromAction );
            }
            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

                                    XmlObject   requestXBean )
   {
      QName bodyElemName = XmlBeanUtils.getName( requestXBean );
      if ( bodyElemName == null )
      {
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT_NOPARAM ) );
      }

      if ( LOG.isDebugEnabled(  ) )
      {
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,
View Full Code Here

         {
            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

               strBuf.append( errorList.get( i ) );
               strBuf.append( "\n" );
            }

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

         throw new ResourceUnknownFaultException( ( (AbstractResourceHome) m_resourceContext.getResourceHome(  ) )
                                                  .getNamespaceSet(  ), rue );
      }
      catch ( ResourceException re )
      {
         throw new FaultException( Soap1_1Constants.FAULT_SERVER, "Internal server error." );
      }
   }
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." );
         }

         XmlObject requestXBean;
         if ( childElems.length == 0 ) // empty Body
         {
            requestXBean = null;
            if ( methodNameFromAction != null )
            {
               // try to find a method based on the wsa:Action...
               serviceMethod = getServiceMethod( service, methodNameFromAction );
            }
            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

                                    XmlObject   requestXBean )
   {
      QName bodyElemName = XmlBeanUtils.getName( requestXBean );
      if ( bodyElemName == null )
      {
         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
                                   MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT_NOPARAM ) );
      }

      if ( LOG.isDebugEnabled(  ) )
      {
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,
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.