Examples of SoapFault


Examples of org.apache.cxf.binding.soap.SoapFault

                    try {
                        xtw.writeStartElement(soapPrefix,
                                              soapVersion.getHeader().getLocalPart(),
                                              soapVersion.getNamespace());
                    } catch (XMLStreamException e) {
                        throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE),
                            e, soapVersion.getSender());
                    }
                    startedHeader = true;
                }
                DataWriter<XMLStreamWriter> dataWriter = getDataWriter(message);
                dataWriter.write(arg, header.getPart(), xtw);
            }
           
            if (startedHeader || preexistingHeaders) {
                try {
                    xtw.writeEndElement();
                    endedHeader = true;
                } catch (XMLStreamException e) {
                    throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE),
                        e, soapVersion.getSender());
                }
            }
        }
        return endedHeader;
View Full Code Here

Examples of org.apache.cxf.binding.soap.SoapFault

        try {
            greeter.greetMe("cxf");
            fail("Twoway operation unexpectedly succeded.");
        } catch (WebServiceException ex) {
            Throwable cause = ex.getCause();
            SoapFault sf = (SoapFault)cause;
           
            assertEquals(expectedMsg, sf.getReason());
            assertEquals(SOAP_FAULT_CODE, sf.getFaultCode());
        }
       
        try {
            greeter.pingMe();
            fail("Expected PingMeFault not thrown.");
        } catch (WebServiceException ex) {
            Throwable cause = ex.getCause();
            SoapFault sf = (SoapFault)cause;
            assertEquals(expectedMsg, sf.getReason());
            assertEquals(SOAP_FAULT_CODE, sf.getFaultCode());
       
    }
View Full Code Here

Examples of org.apache.cxf.binding.soap.wsdl.extensions.SoapFault

        soapBinding.setTransportURI(bi.getTransportURI());
        bi.addExtensor(soapBinding);

        for (BindingOperationInfo b : bi.getOperations()) {
            for (BindingFaultInfo faultInfo : b.getFaults()) {
                SoapFault soapFault = SOAPBindingUtil.createSoapFault(extensionRegistry, isSoap12);
                soapFault.setUse("literal");
                soapFault.setName(faultInfo.getFaultInfo().getFaultName().getLocalPart());
                faultInfo.addExtensor(soapFault);
            }
            SoapOperationInfo soi = b.getExtensor(SoapOperationInfo.class);

            SoapOperation soapOperation = SOAPBindingUtil.createSoapOperation(extensionRegistry,
View Full Code Here

Examples of org.apache.cxf.tools.common.extensions.soap.SoapFault

        soapBinding.setTransportURI(bi.getTransportURI());
        bi.addExtensor(soapBinding);

        for (BindingOperationInfo b : bi.getOperations()) {
            for (BindingFaultInfo faultInfo : b.getFaults()) {
                SoapFault soapFault = SOAPBindingUtil.createSoapFault(extensionRegistry, isSoap12);
                soapFault.setUse("literal");
                soapFault.setName(faultInfo.getFaultInfo().getFaultName().getLocalPart());
                faultInfo.addExtensor(soapFault);
            }
            SoapOperationInfo soi = b.getExtensor(SoapOperationInfo.class);

            SoapOperation soapOperation = SOAPBindingUtil.createSoapOperation(extensionRegistry,
View Full Code Here

Examples of org.apache.muse.ws.addressing.soap.SoapFault

            configParams = readConfigFile(_installDir + "/conf/httpd.conf");
        }
       
        catch (IOException error)
        {
            throw new SoapFault("Error while reading httpd.conf.", error);
        }
       
        _name = readName(configParams);
        _port = readPort(configParams);
        _languages = readLanguages(configParams);
View Full Code Here

Examples of org.apache.servicemix.soap.SoapFault

                throw retry;
            } catch (SoapFault fault) {
                sendFault(fault, request, response);
                return;
            } catch (Exception e) {
                SoapFault fault = new SoapFault(e);
                sendFault(fault, request, response);
                return;
            }
        } else {
            String id = (String) request.getAttribute(MessageExchange.class.getName());
View Full Code Here

Examples of org.apache.servicemix.soap.bindings.soap.SoapFault

                soapVersion = SoapVersionFactory.getInstance().getSoapVersion(name);
            } else {
                soapVersion = soapVersion.getDerivedVersion(name.getPrefix());
            }
            if (soapVersion == null) {
                throw new SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH, "Unrecognized namespace: "
                                + xmlReader.getNamespaceURI() + " at ["
                                + xmlReader.getLocation().getLineNumber() + ","
                                + xmlReader.getLocation().getColumnNumber()
                                + "]. Expecting a Soap 1.1 or 1.2 namespace.");
            }
            message.put(SoapVersion.class, soapVersion);
            if (!name.equals(soapVersion.getEnvelope())) {
                if (name.getLocalPart().equals(soapVersion.getEnvelope().getLocalPart())) {
                    throw new SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH,
                          "Expected a SOAP " + soapVersion.getVersion() + " request");
                }
                throw new SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH, "Unrecognized element: "
                                + xmlReader.getName() + " at ["
                                + xmlReader.getLocation().getLineNumber() + ","
                                + xmlReader.getLocation().getColumnNumber()
                                + "]. Expecting 'Envelope'.");
            }
            xmlReader.nextTag();
            if (xmlReader.getName().equals(soapVersion.getHeader())) {
                Map<QName, DocumentFragment> headers = message.getSoapHeaders();
                while (xmlReader.nextTag() != XMLStreamConstants.END_ELEMENT) {
                    QName hn = xmlReader.getName();
                    Element e = StaxUtil.createElement(xmlReader);
                    DocumentFragment df = headers.get(hn);
                    if (df == null) {
                        df = e.getOwnerDocument().createDocumentFragment();
                    }
                    e = (Element) df.getOwnerDocument().importNode(e, true);
                    df.appendChild(e);
                    headers.put(hn, df);
                }
                xmlReader.nextTag();
            }
            if (!xmlReader.getName().equals(soapVersion.getBody())) {
                throw new SoapFault(SoapFault.SENDER, "Unrecognized element: "
                                + xmlReader.getName() + ". Expecting 'Body'.");
            }
            if (xmlReader.nextTag() == XMLStreamConstants.END_ELEMENT) {
                // Empty body
                message.setContent(XMLStreamReader.class, null);
View Full Code Here

Examples of org.apache.ws.commons.soap.SOAPFault

            // check for a fault and return the result
            SOAPEnvelope resenvelope = response.getEnvelope();

            if (resenvelope.getBody().hasFault()) {
                SOAPFault soapFault = resenvelope.getBody().getFault();
                Exception ex = soapFault.getException();

                if (clientOptions.isExceptionToBeThrownOnSOAPFault()) {

                    // does the SOAPFault has a detail element for Excpetion
                    if (ex != null) {
                        throw new AxisFault(ex);
                    } else {

                        // if detail element not present create a new Exception from the detail
                        String message = "";

                        message = (message + "Code =" + soapFault.getCode() == null)
                                ? ""
                                : (soapFault.getCode().getValue() == null)
                                ? ""
                                : soapFault.getCode().getValue().getText();
                        message = (message + "Reason =" + soapFault.getReason() == null)
                                ? ""
                                : (soapFault.getReason().getSOAPText() == null)
                                ? ""
                                : soapFault.getReason().getSOAPText().getText();

                        throw new AxisFault(message);
                    }
                }
            }
View Full Code Here

Examples of org.apache.xmlbeans.impl.soap.SOAPFault

    public static void soapFault_setFaultString ( Dom d, String faultString )
    {
        Locale l = d.locale();

        SOAPFault sf = (SOAPFault) d;

        if (l.noSync())         { l.enter(); try { l._saaj.soapFault_setFaultString( sf, faultString ); } finally { l.exit(); } }
        else synchronized ( l ) { l.enter(); try { l._saaj.soapFault_setFaultString( sf, faultString ); } finally { l.exit(); } }
    }
View Full Code Here

Examples of org.eclipse.wst.wsdl.binding.soap.SOAPFault

    // Is it worth being smarter?  Look for matching content first and create those which aren't found????
    List removeList = new ArrayList(bindingFault.getEExtensibilityElements());
    removeExtensebilityElements(bindingFault.getEExtensibilityElements(), removeList);

    SOAPFactory soapFactory = SOAPFactory.eINSTANCE;
    SOAPFault soapFault = soapFactory.createSOAPFault();
    soapFault.setUse((getUseOption(bindingFault) == USE_ENCODED) ? "encoded" : "literal");
    soapFault.setName(fault.getName());
    //  soapFault.setNamespaceURI(getNamespace(bindingFault));

    if (getUseOption(bindingFault) == USE_ENCODED && getStyleOption(bindingFault) == STYLE_RPC)
    {
      List encodingList = new BasicEList();
      encodingList.add("http://schemas.xmlsoap.org/soap/encoding/");
      soapFault.setEncodingStyles(encodingList);
    }

    bindingFault.addExtensibilityElement(soapFault);
  }
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.