Examples of OdeFault


Examples of org.apache.ode.axis2.OdeFault

            }
            AxisEngine engine = new AxisEngine(
                    msgContext.getOperationContext().getServiceContext().getConfigurationContext());
            engine.send(outMsgContext);
        } catch (IllegalAccessException e) {
            throw new OdeFault("Couldn't invoke method named " + methodName + " in management interface!", e);
        } catch (InvocationTargetException e) {
            throw new OdeFault("Invocation of method " + methodName + " in management interface failed!", e.getTargetException());
        }
    }
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

            try {
                Class beanFactory = Class.forName(clazz.getCanonicalName() + ".Factory");
                return beanFactory.getMethod("parse", XMLStreamReader.class)
                        .invoke(elmt.getXMLStreamReaderWithoutCaching());
            } catch (ClassNotFoundException e) {
                throw new OdeFault("Couldn't find class " + clazz.getCanonicalName() + ".Factory to instantiate xml bean", e);
            } catch (IllegalAccessException e) {
                throw new OdeFault("Couldn't access class " + clazz.getCanonicalName() + ".Factory to instantiate xml bean", e);
            } catch (InvocationTargetException e) {
                throw new OdeFault("Couldn't access xml bean parse method on class " + clazz.getCanonicalName() + ".Factory " +
                        "to instantiate xml bean", e);
            } catch (NoSuchMethodException e) {
                throw new OdeFault("Couldn't find xml bean parse method on class " + clazz.getCanonicalName() + ".Factory " +
                        "to instantiate xml bean", e);
            }
        } else throw new OdeFault("Couldn't use element " + elmt + " to obtain a management method parameter.");
    }
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

    private static OMElement convertToOM(SOAPFactory soapFactory, Object obj) throws AxisFault {
        if (obj instanceof XmlObject) {
            try {
                return new StAXOMBuilder(((XmlObject)obj).newInputStream()).getDocumentElement();
            } catch (XMLStreamException e) {
                throw new OdeFault("Couldn't serialize result to an outgoing messages.", e);
            }
        } else if (obj instanceof List) {
            OMElement listElmt = soapFactory.createOMElement("list", null);
            for (Object stuff : ((List) obj)) {
                OMElement stuffElmt = soapFactory.createOMElement("element", null);
                stuffElmt.setText(stuff.toString());
                listElmt.addChild(stuffElmt);
            }
            return listElmt;
        } else throw new OdeFault("Couldn't convert object " + obj + " into a response element.");
    }
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

    private static Method findMethod(Class clazz, String methodName) throws AxisFault {
        for (Method method : clazz.getMethods()) {
            if (method.getName().equals(methodName)) return method;
        }
        throw new OdeFault("Couldn't find any method named " + methodName + " in interface " + clazz.getName());
    }
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

        _serviceName = serviceName;
        _portName = portName;

        _serviceDef = _def.getService(serviceName);
        if (_serviceDef == null)
            throw new OdeFault(__msgs.msgServiceDefinitionNotFound(serviceName));
        _port = _serviceDef.getPort(portName);
        if (_port == null)
            throw new OdeFault(__msgs.msgPortDefinitionNotFound(serviceName, portName));
        _binding = _port.getBinding();
        if (_binding == null)
            throw new OdeFault(__msgs.msgBindingNotFound(serviceName, portName));


        Collection<SOAPBinding> soapBindings = CollectionsX.filter(_binding.getExtensibilityElements(), SOAPBinding.class);
        if (soapBindings.isEmpty())
            throw new OdeFault(__msgs.msgNoSOAPBindingForPort(_portName));
        else if (soapBindings.size() > 1) {
            throw new OdeFault(__msgs.msgMultipleSoapBindingsForPort(_portName));
        }

        _soapBinding = (SOAPBinding) soapBindings.iterator().next();
        String style = _soapBinding.getStyle();
        _isRPC = style != null && style.equals("rpc");
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

            throw new NullPointerException("Null msgCtx");

        BindingOperation bop = _binding.getBindingOperation(op.getName(), null, null);

        if (bop == null)
            throw new OdeFault(__msgs.msgBindingOperationNotFound(_serviceName, _portName, op.getName()));

        BindingInput bi = bop.getBindingInput();
        if (bi == null)
            throw new OdeFault(__msgs.msgBindingInputNotFound(_serviceName, _portName, op.getName()));

        SOAPEnvelope soapEnv = msgCtx.getEnvelope();
        if (soapEnv == null) {
            soapEnv = _soapFactory.getDefaultEnvelope();
            msgCtx.setEnvelope(soapEnv);
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

            throw new NullPointerException("Null msgCtx");

        BindingOperation bop = _binding.getBindingOperation(op.getName(),null,null);

        if (bop == null)
            throw new OdeFault(__msgs.msgBindingOperationNotFound(_serviceName, _portName, op.getName()));

        BindingOutput bo = bop.getBindingOutput();
        if (bo == null)
            throw new OdeFault(__msgs.msgBindingOutputNotFound(_serviceName, _portName, op.getName()));

        SOAPEnvelope soapEnv = msgCtx.getEnvelope();
        if (soapEnv == null) {
            soapEnv = _soapFactory.getDefaultEnvelope();
            msgCtx.setEnvelope(soapEnv);
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

        if (headerdef.getPart() == null)
            return;

        if (payloadMessageHeader && msgdef.getPart(headerdef.getPart()) == null)
            throw new OdeFault(__msgs.msgSoapHeaderReferencesUnkownPart(headerdef.getPart()));

        Element srcPartEl = null;
        // Message can be null if the operation message has no part
        if (message != null) {
            if (payloadMessageHeader)
                srcPartEl = DOMUtils.findChildByName(message, new QName(null, headerdef.getPart()));
            else {
                Element fho = DOMUtils.findChildByName(message, FOREIGN_HEADER_OUT);
                if (fho != null) {
                    srcPartEl = DOMUtils.findChildByName(fho, headerdef.getElementType());
                }
            }
        }

        // We don't complain about missing header data unless they are part of the message payload. This is
        // because AXIS may be providing these headers.
        if (srcPartEl == null && payloadMessageHeader)
            throw new OdeFault(__msgs.msgOdeMessageMissingRequiredPart(headerdef.getPart()));

        if (srcPartEl == null)
            return;

        org.apache.axiom.soap.SOAPHeader soaphdr = soapEnv.getHeader();
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

    public void parseSoapRequest(Element odeMessage, SOAPEnvelope envelope, Operation op) throws AxisFault {
        BindingOperation bop = _binding.getBindingOperation(op.getName(), null, null);

        if (bop == null)
            throw new OdeFault(__msgs.msgBindingOperationNotFound(_serviceName, _portName, op.getName()));

        BindingInput bi = bop.getBindingInput();
        if (bi == null)
            throw new OdeFault(__msgs.msgBindingInputNotFound(_serviceName, _portName, op.getName()));

        SOAPBody soapBody = getSOAPBody(bi);
        if (soapBody != null)
            extractSoapBodyParts(odeMessage, envelope.getBody(), soapBody, op.getInput().getMessage(), op.getName());
View Full Code Here

Examples of org.apache.ode.axis2.OdeFault

    public void parseSoapResponse(Element odeMessage, SOAPEnvelope envelope, Operation op) throws AxisFault {
        BindingOperation bop = _binding.getBindingOperation(op.getName(), null, null);

        if (bop == null)
            throw new OdeFault(__msgs.msgBindingOperationNotFound(_serviceName, _portName, op.getName()));

        BindingOutput bo = bop.getBindingOutput();
        if (bo == null)
            throw new OdeFault(__msgs.msgBindingInputNotFound(_serviceName, _portName, op.getName()));

        SOAPBody soapBody = getSOAPBody(bo);
        if (soapBody != null)
            extractSoapBodyParts(odeMessage, envelope.getBody(),
                    soapBody, op.getOutput().getMessage(), op.getName() + "Response");
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.