Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.FaultInfo


       
        OperationInfo op = service.getServiceInfo().getOperation("echo");
       
        assertEquals(1, op.getFaults().size());
       
        FaultInfo info = op.getFault("EchoFault");
        assertNotNull(info);
       
        assertEquals(1, info.getMessageParts().size());
        MessagePartInfo mp = info.getMessagePart(new QName(service.getName().getNamespaceURI(),
                                                           "EchoFault"));
        assertEquals(EchoFault.class, mp.getTypeClass());
    }
View Full Code Here


     */
    public static Service getEchoFaultService()
    {
        Service endpoint = getEchoService();
        OperationInfo operation = endpoint.getServiceInfo().getOperation("echo");
        FaultInfo fault = operation.addFault("echoFault");
        fault.addMessagePart(new QName("echoFault0"), String.class);

        return endpoint;
    }
View Full Code Here

        return (ServiceInfo) portType2serviceInfo.get(portType);
    }

    protected void visit(Fault fault)
    {
        FaultInfo faultInfo = opInfo.addFault(fault.getName());
        faultInfo.setMessageName(fault.getMessage().getQName());
        if(fault.getDocumentationElement()!= null ){
            faultInfo.setDocumentation(fault.getDocumentationElement().getNodeValue());//TextContent());   
        }
       
        wfault2msg.put(fault, faultInfo);
       
        createMessageParts(faultInfo, fault.getMessage());
View Full Code Here

            op = context.getExchange().getOperation();

        if (cause == null || op == null)
            return;

        FaultInfo faultPart = getFaultForClass(op, cause.getClass());

        if (faultPart != null)
        {
            handleFault(context, fault, cause, (MessagePartInfo) faultPart.getMessageParts().get(0));
        }
    }
View Full Code Here

     */
    public FaultInfo getFaultForClass(OperationInfo op, Class class1)
    {
        for (Iterator itr = op.getFaults().iterator(); itr.hasNext();)
        {
            FaultInfo faultInfo = (FaultInfo) itr.next();
           
            if (faultInfo.getExceptionClass().isAssignableFrom(class1))
            {
                return faultInfo;
            }
        }
       
View Full Code Here

    {
        QName qname = new QName(exDetail.getNamespaceURI(), exDetail.getName());
       
        for (Iterator itr = operation.getFaults().iterator(); itr.hasNext();)
        {
            FaultInfo faultInfo = (FaultInfo) itr.next();
           
            MessagePartInfo part = faultInfo.getMessagePart(qname);
           
            if (part != null) return part;
        }
       
        return null;
View Full Code Here

                Collection bindingFaults = bindingOperation.getBindingFaults().values();
                for (Iterator iterator2 = bindingFaults.iterator(); iterator2.hasNext();)
                {
                    BindingFault bindingFault = (BindingFault) iterator2.next();
                    Fault fault = bindingOperation.getOperation().getFault(bindingFault.getName());
                    FaultInfo faultInfo = opInfo.getFault(fault.getName());
                   
                    ann.visit(bindingFault, fault, faultInfo);
                }

            }
View Full Code Here

            // Create the fault messages
            List faultMessages = new ArrayList();
            for (Iterator faultItr = op.getFaults().iterator(); faultItr.hasNext();)
            {
                FaultInfo fault = (FaultInfo) faultItr.next();
                Fault faultMsg = createFault(op, fault);
                if( fault.getDocumentation()!= null ){
                    faultMsg.setDocumentationElement(createElement(fault.getDocumentation()));   
                }
               
                faultMessages.add(faultMsg);
            }
View Full Code Here

           
            try
            {
                for (Iterator faultItr = opInfo.getFaults().iterator(); faultItr.hasNext();)
                {
                    FaultInfo info = (FaultInfo) faultItr.next();
                    initializeMessage(endpoint, info, FAULT_PARAM);
                }
            }
            catch(XFireRuntimeException e)
            {
View Full Code Here

    protected void generateFaults(GenerationContext context, OperationInfo op, JMethod method)
        throws GenerationException
    {
        for (Iterator itr = op.getFaults().iterator(); itr.hasNext();)
        {
            FaultInfo faultInfo = (FaultInfo) itr.next();
           
            //List messageParts = faultInfo.getMessageParts();
            /*if (messageParts.size() > 1)
            {
                throw new GenerationException("Operation " + op.getName() + " has a fault " + faultInfo.getName() +
                                              " with multiple parts. This is not supported at this time.");
            }*/
           
            JClass exCls = getExceptionClass(context, faultInfo);
           
            if (exCls == null)
                throw new GenerationException("Could not find generated " +
                        "fault class for " + faultInfo.getName() + "!");
           
            if( faultInfo.getDocumentation()!= null){
             JCommentPart commentPart = method.javadoc().addThrows(exCls);
             commentPart.add(faultInfo.getDocumentation());
            
            }
           
            method._throws(exCls);
        }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.service.FaultInfo

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.