Package org.apache.axis

Examples of org.apache.axis.AxisFault


                                QName fieldXmlType,
                                Element where) throws Exception {

        // Attribute must be a simple type.
        if (!types.isAcceptableAsAttribute(fieldType)) {
            throw new AxisFault(Messages.getMessage("AttrNotSimpleType00",
                                                     fieldName,
                                                     fieldType.getName()));
        }
        Element elem = types.createAttributeElement(fieldName,
                                           fieldType, fieldXmlType,
View Full Code Here


            if ( hName != null ) {
                h = getHandler( hName );
                if ( h != null )
                    h.invoke(msgContext);
                else
                    throw new AxisFault( "Client.error",
                                        Messages.getMessage("noHandler00", hName),
                                        null, null );
            }
            else {
                // This really should be in a handler - but we need to discuss it
                // first - to make sure that's what we want.

                /* Now we do the 'real' work.  The flow is basically:         */
                /*                                                            */
                /*   Service Specific Request Chain                           */
                /*   Global Request Chain                                     */
                /*   Transport Request Chain - must have a send at the end    */
                /*   Transport Response Chain                                 */
                /*   Global Response Chain                                    */
                /*   Service Specific Response Chain                          */
                /*   Protocol Specific-Handler/Checker                        */
                /**************************************************************/

                // When do we call init/cleanup??

                SOAPService service = null ;
                msgContext.setPastPivot(false);

                /* Process the Service Specific Request Chain */
                /**********************************************/
                service = msgContext.getService();
                if ( service != null ) {
                    h = service.getRequestHandler();
                    if ( h != null )
                        h.invoke( msgContext );
                }

                /* Process the Global Request Chain */
                /**********************************/
                if ((h = getGlobalRequest()) != null )
                    h.invoke(msgContext);

                /* Process the JAXRPC Handlers */
                invokeJAXRPCHandlers(msgContext);

                /** Process the Transport Specific stuff
                 *
                 * NOTE: Somewhere in here there is a handler which actually
                 * sends the message and receives a response.  Generally
                 * this is the pivot point in the Transport chain.
                 */
                hName = msgContext.getTransportName();
                if ( hName != null && (h = getTransport( hName )) != null ) {
                    h.invoke(msgContext);
                }
                else {
                    throw new AxisFault(
                        Messages.getMessage("noTransport00", hName));
                }

                /* Process the JAXRPC Handlers */
                invokeJAXRPCHandlers(msgContext);
View Full Code Here

    public synchronized void addEntry(java.lang.String name,
                                      Address address) throws AxisFault
    {
        if (call.get(HTTPTransport.URL) == null)
        {
            throw new AxisFault(
                "A URL must be specified via " +
                    "AddressBookProxy.setEndPoint(URL).");
        }
       
        Object resp = call.invoke(service, "addEntry",
View Full Code Here

    public synchronized Address getAddressFromName
        (java.lang.String name) throws AxisFault
    {
        if (call.get(HTTPTransport.URL) == null)
        {
            throw new AxisFault(
                "A URL must be specified via " +
                    "AddressBookProxy.setEndPoint(URL).");
        }
       
        Object resp = call.invoke(service, "getAddressFromName",
View Full Code Here

      for (int i=0; i<count; i++) {
          Object ret = call.invoke(
          namespace, "getQuote", new Object[] {symbol} );
          if (ret instanceof String) {
              System.out.println("Received problem response from server: "+ret);
              throw new AxisFault("", (String)ret, null, null);
          }
        res = (Float) ret;
      }

        return res.floatValue();
View Full Code Here

      for (int i=0; i<count; i++) {
          Object ret = call.invoke(
          namespace, "getQuote", new Object[] {symbol} );
          if (ret instanceof String) {
              System.out.println("Received problem response from server: "+ret);
              throw new AxisFault("", (String)ret, null, null);
          }
        res = (Float) ret;
      }

        return res.floatValue();
View Full Code Here

            msg = msgContext.getResponseMessage();
        } catch (AxisFault af) {
            msg = new Message(af);
            msg.setMessageContext(msgContext);
        } catch (Exception e) {
            msg = new Message(new AxisFault(e.toString()));
            msg.setMessageContext(msgContext);
        }
       
        byte[] buf = (byte[]) msg.getAsBytes();
        FileOutputStream fos = new FileOutputStream( "xml" + thisNum + ".res" );
View Full Code Here

        // File not there - just loop
      }
    }
    nextNum++ ;
    if (timedOut)
        throw new AxisFault("timeout");

  }
View Full Code Here

        AuthenticatedUser user = (AuthenticatedUser)msgContext.
                                         getProperty(MessageContext.AUTHUSER);

        if (user == null)
            throw new AxisFault("Server.NoUser",
                    "Need to specify a user for authorization!", null, null);

        String userID = user.getName();
        Handler serviceHandler = msgContext.getServiceHandler();

        if (serviceHandler == null)
            throw new AxisFault("No target service to authorize for!");

        String serviceName = serviceHandler.getName();

        String allowedRoles = (String)serviceHandler.getOption("allowedRoles");
        if (allowedRoles == null) {
            String action = allowByDefault ? "allowing." : "disallowing.";
            category.info("No roles specified for target service, " + action);
            if (!allowByDefault) {
                throw new AxisFault( "Server.Unauthorized",
                    "User '" + userID + "' not authorized to '" +
                    serviceName + "'",
                    null, null );
            }
            category.debug("Exit: SimpleAuthorizationHandler::invoke" );
            return;
        }

        SecurityProvider provider = (SecurityProvider)msgContext.getProperty("securityProvider");
        if (provider == null)
            throw new AxisFault("No security provider in MessageContext!");

        StringTokenizer st = new StringTokenizer(allowedRoles, ",");
        while (st.hasMoreTokens()) {
            String thisRole = st.nextToken();
            if (provider.userMatches(user, thisRole)) {
                category.info("User '" + userID + "' authorized to: "
                              + serviceName);
                category.debug("Exit: SimpleAuthorizationHandler::invoke" );
                return;
            }
        }

        throw new AxisFault( "Server.Unauthorized",
            "User '" + userID + "' not authorized to '" +
            serviceName + "'",
            null, null );
    }
View Full Code Here

        context.endElement();
    }
   
    public AxisFault getAxisFault()
    {
        if (fault == null) fault = new AxisFault();
        return fault;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.AxisFault

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.