Examples of XFireFault


Examples of org.codehaus.xfire.fault.XFireFault

        Transport t = null;
        Channel c = null;
       
        if (addr == null)
        {
            throw new XFireFault("Invalid ReplyTo address.", XFireFault.SENDER);
        }
       
        if (addr.equals(factory.getAnonymousUri()))
        {
            outMessage = new OutMessage(Channel.BACKCHANNEL_URI);
            c = context.getInMessage().getChannel();
            t = c.getTransport();
        }
        else
        {
            if (isNoneAddress(factory, addr))
            {
                t = new DeadLetterTransport();
                outMessage = new OutMessage(addr);
                c = t.createChannel();
            }
            else
            {
                outMessage = new OutMessage(addr);
                t = context.getXFire().getTransportManager().getTransportForUri(addr);
                c = t.createChannel();
            }
        }
       
        outMessage.setChannel(c);
        outMessage.setSoapVersion(context.getExchange().getInMessage().getSoapVersion());

        if (t == null)
        {
            throw new XFireFault("URL was not recognized: " + addr, XFireFault.SENDER);
        }

        AddressingHeaders headers = new AddressingHeaders();
        // Fault can have only refrenceParameters
        if (!isFault)
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

    }

    public void invoke(MessageContext context)
        throws Exception
    {
        XFireFault fault = (XFireFault) context.getExchange().getFaultMessage().getBody();
       
        Throwable cause = fault.getCause();
        OperationInfo op = null;
       
        if (context.getExchange() != null)
            op = context.getExchange().getOperation();
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

        {
            AbstractBinding.writeParameter(writer, context, faultBean, faultPart, faultPart.getName().getNamespaceURI());
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Could not write to outgoing stream.", e, XFireFault.RECEIVER);
        }
    }
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

        Channel c = context.getInMessage().getChannel();
        Service service = context.getService();
       
        if (service == null)
        {
            throw new XFireFault("Could not find a service to invoke.", XFireFault.SENDER);
        }
       
        // find a binding with that soap binding id
        // set the binding
        Binding binding =  c.getTransport().findBinding(context, service);
       
        if (binding == null)
        {
            throw new XFireFault("Could not find an appropriate Transport Binding to invoke.", XFireFault.SENDER);
        }
       
        if (!binding.isUndefinedEndpointAllowed())
        {
            boolean defined = false;
            for (Iterator itr = service.getEndpoints().iterator(); itr.hasNext();)
            {
                if (((Endpoint) itr.next()).getUrl().equals(c.getUri()))
                {
                    defined = true;
                    break;
                }
            }
           
            if (!defined)
            {
                throw new XFireFault("Invalid endpoint for service.", XFireFault.SENDER);
            }
        }
       
        context.setBinding(binding);
    }
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

public class ClientFaultConverter extends AbstractHandler
{
    public void invoke(MessageContext context)
        throws Exception
    {
        XFireFault fault = (XFireFault) context.getExchange().getFaultMessage().getBody();
       
        if (fault.getDetail() != null && fault.getDetail().getChildren().size() > 0)
        {
            processFaultDetail(fault, context);
        }
    }
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

                else
                    return null;
            }
            catch (XMLStreamException e)
            {
                throw new XFireFault("Couldn't parse stream.", e, XFireFault.SENDER);
            }
        }
        else if (Document.class.isAssignableFrom(p.getTypeClass()))
        {
            try
            {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();

                return STAXUtils.read(builder, reader, true);
            }
            catch(Exception e)
            {
                throw new XFireFault("Couldn't read message.", e, XFireFault.SENDER);
            }
        }
        else if (p.getTypeClass().isAssignableFrom(MessageContext.class))
        {
            return context;
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

           
            inPipe.invoke(context);
        }
        catch (Exception e1)
        {
            XFireFault fault = XFireFault.createFault(e1);
           
            AbstractMessage faultMsg = context.getExchange().getFaultMessage();
            faultMsg.setBody(fault);
           
            context.setCurrentMessage(faultMsg);
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

                p = findMessagePart(context, operations, dr.getName(), param);
            }
           
            if (p == null)
            {
                throw new XFireFault("Parameter " + dr.getName() + " does not exist!",
                                     XFireFault.SENDER);
            }

            param++;
            parameters.add( context.getService().getBindingProvider().readParameter(p, dr, context) );
           
            if (dr.getEventType() == XMLStreamReader.END_ELEMENT) nextEvent(dr);
        }

        if (opInfo == null && !clientMode)
        {
            opInfo = findOperation(operations, parameters);

            if (opInfo == null)
            {
                StringBuffer sb = new StringBuffer("Could not find appropriate operation for request ");
                //we know we have at least one operation, right?
                sb.append(((OperationInfo)operations.iterator().next()).getName());
                sb.append('(');
                for(Iterator iterator = parameters.iterator(); iterator.hasNext();)
                {
                    sb.append(iterator.next().getClass().getName());
                    if(iterator.hasNext())
                    {
                        sb.append(", ");
                    }
                }
                sb.append(") in service '");
                sb.append(context.getService().getSimpleName());
                sb.append('\'');
                throw new XFireFault(sb.toString(), XFireFault.SENDER);
            }
           
            setOperation(opInfo, context);
        }
       
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

    protected Object getClientParam(Object[] values, MessagePartInfo outParam, MessageContext context)
        throws XFireFault
    {
        if (outParam.getIndex() >= values.length)
        {
            throw new XFireFault("Not enough input parameters were supplied!", XFireFault.SENDER);
        }
       
        return values[outParam.getIndex()];
    }
View Full Code Here

Examples of org.codehaus.xfire.fault.XFireFault

         * env:Sender               400          <bad-request/>
         * env:Receiver             500          <internal-server-error/>
         * env:DataEncodingUnknown  500          <internal-server-error/>
         */

        XFireFault fault = (XFireFault) context.getExchange().getFaultMessage().getBody();
        XMPPError error = null;
        if (fault.getFaultCode().equals(XFireFault.SENDER))
        {
            error = new XMPPError(400);
        }
        else
        {
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.