org.apache.axis.AxisFault - java examples

Here are the examples of the java api org.apache.axis.AxisFault taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

78 Examples 7

19 View Complete Implementation : BirtGetPageActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Check whether doreplacedent existed
 */
protected void __checkDoreplacedentExists() throws Exception {
    File file = new File(__docName);
    if (!file.exists()) {
        BirtRunReportActionHandler handler = new BirtRunReportActionHandler(context, operation, response);
        handler.__execute();
    }
    file = new File(__docName);
    if (!file.exists()) {
        AxisFault fault = new AxisFault();
        fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_NO_REPORT_DOreplacedENT));
        throw fault;
    } else {
        // If doreplacedent isn't completed, throw Exception
        BaseAttributeBean bean = (BaseAttributeBean) context.getBean();
        if (bean.isDoreplacedentProcessing()) {
            AxisFault fault = new AxisFault();
            fault.setFaultReason(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_DOreplacedENT_FILE_PROCESSING));
            throw fault;
        }
    }
}

19 View Complete Implementation : TestSOAPFaultException.java
Copyright Apache License 2.0
Author : apache
/**
 * Checks if the AxisFault contains the expected detail elements
 *
 * @param axisFault
 */
private void checkDetailAgainstTestDetail(AxisFault axisFault) {
    Element[] details = axisFault.getFaultDetails();
    replacedertEquals("wrong name for detail element", "MyDetails", details[0].getNodeName());
    replacedertEquals("wrong node value for detail element", "hossa", ((Text) details[0].getChildNodes().item(0)).getData());
    replacedertEquals("wrong name for foo element", "foo", details[1].getNodeName());
    boolean found = false;
    NodeList childs = details[1].getChildNodes();
    for (int i = 0; i < childs.getLength(); i++) {
        if ("baz".equals(childs.item(i).getNodeName()))
            found = true;
    }
    replacedertTrue("subelement baz not found in details", found);
}

19 View Complete Implementation : SOAPFault.java
Copyright Apache License 2.0
Author : apache
public void setFault(AxisFault fault) {
    this.fault = fault;
}

19 View Complete Implementation : AbstractQueryStringHandler.java
Copyright Apache License 2.0
Author : apache
/**
 * Extract information from AxisFault and map it to a HTTP Status code.
 *
 * @param af Axis Fault
 * @return HTTP Status code.
 */
private int getHttpServletResponseStatus(AxisFault af) {
    // TODO: Should really be doing this with explicit AxisFault
    // subclreplacedes... --Glen
    return af.getFaultCode().getLocalPart().startsWith("Server.Unauth") ? HttpServletResponse.SC_UNAUTHORIZED : HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
// This will raise a 401 for both
// "Unauthenticated" & "Unauthorized"...
}

19 View Complete Implementation : FaultEncode.java
Copyright Apache License 2.0
Author : apache
// ctor
public void testFault() throws Exception {
    AxisFault fault = new AxisFault("<code>", "<string>", "<actor>", null);
    fault.setFaultDetailString("<detail>");
    AxisServer server = new AxisServer();
    Message message = new Message(fault);
    message.setMessageContext(new MessageContext(server));
    String data = message.getSOAPPartreplacedtring();
    replacedertTrue("Fault code not encoded correctly", data.indexOf("<code>") >= 0);
    replacedertTrue("Fault string not encoded correctly", data.indexOf("<string>") >= 0);
    replacedertTrue("Fault actor not encoded correctly", data.indexOf("<actor>") >= 0);
    replacedertTrue("Fault detail not encoded correctly", data.indexOf("<detail>") >= 0);
}

19 View Complete Implementation : BirtGetReportletActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 */
protected void __checkDoreplacedentExists() throws Exception {
    File file = new File(__docName);
    if (!file.exists()) {
        BirtRunReportActionHandler handler = new BirtRunReportActionHandler(context, operation, response);
        handler.__execute();
    }
    file = new File(__docName);
    if (!file.exists()) {
        AxisFault fault = new AxisFault();
        fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_NO_REPORT_DOreplacedENT));
        throw fault;
    }
}

19 View Complete Implementation : InquiryServiceTestCase.java
Copyright Apache License 2.0
Author : apache
public void test2InquiryService1Find_business() throws Exception {
    test.wsdl.uddiv2.inquiry_v2.InquireSoapStub binding;
    try {
        binding = (test.wsdl.uddiv2.inquiry_v2.InquireSoapStub) new test.wsdl.uddiv2.InquiryServiceLocator().getInquiryService1();
    } catch (javax.xml.rpc.ServiceException jre) {
        if (jre.getLinkedCause() != null)
            jre.getLinkedCause().printStackTrace();
        throw new junit.framework.replacedertionFailedError("JAX-RPC ServiceException caught: " + jre);
    }
    replacedertNotNull("binding is null", binding);
    // Time out after a minute
    binding.setTimeout(60000);
    test.wsdl.uddiv2.api_v2.Find_business find = new test.wsdl.uddiv2.api_v2.Find_business();
    find.setGeneric("2.0");
    find.setMaxRows(new Integer(100));
    test.wsdl.uddiv2.api_v2.Name[] names = new test.wsdl.uddiv2.api_v2.Name[1];
    names[0] = new test.wsdl.uddiv2.api_v2.Name();
    names[0].set_value("IBM");
    find.setName(names);
    // Test operation
    try {
        test.wsdl.uddiv2.api_v2.BusinessList list = null;
        list = binding.find_business(find);
        test.wsdl.uddiv2.api_v2.BusinessInfos infos = list.getBusinessInfos();
        test.wsdl.uddiv2.api_v2.BusinessInfo[] infos2 = infos.getBusinessInfo();
        for (int i = 0; i < infos2.length; i++) {
            System.out.println(infos2[i].getBusinessKey());
        }
    } catch (test.wsdl.uddiv2.api_v2.DispositionReport e1) {
        throw new junit.framework.replacedertionFailedError("error Exception caught: " + e1);
    } catch (Exception e) {
        e.printStackTrace();
        if (e instanceof AxisFault) {
            AxisFault af = (AxisFault) e;
            if ((af.detail instanceof SocketException) || (af.getFaultCode().getLocalPart().equals("HTTP"))) {
                System.out.println("Connect failure caused testJWSFault to be skipped.");
                return;
            }
        }
        throw new Exception("Fault returned from test: " + e);
    }
}

19 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * test what happens with subclreplacedes. We expect the clreplacedname to be preserved
 * in the details
 */
public void testSubclreplacedProcessing() {
    AxisFault af = new NoEndPointException();
    Element exceptionName;
    exceptionName = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME);
    replacedertNotNull(exceptionName);
    String exceptionClreplacedname = XMLUtils.getInnerXMLString(exceptionName);
    replacedertTrue(exceptionClreplacedname.indexOf("NoEndPointException") >= 0);
}

19 View Complete Implementation : SOAPBody.java
Copyright Apache License 2.0
Author : apache
public javax.xml.soap.SOAPFault addFault() throws SOAPException {
    AxisFault af = new AxisFault(new QName(Constants.NS_URI_AXIS, Constants.FAULT_SERVER_GENERAL), "", "", new Element[0]);
    SOAPFault fault = new SOAPFault(af);
    addChildElement(fault);
    return fault;
}

19 View Complete Implementation : SOAPFault.java
Copyright Apache License 2.0
Author : apache
/**
 * A Fault body element.
 *
 * @author Sam Ruby ([email protected])
 * @author Glen Daniels ([email protected])
 * @author Tom Jordahl ([email protected])
 */
public clreplaced SOAPFault extends SOAPBodyElement implements javax.xml.soap.SOAPFault {

    protected AxisFault fault;

    protected String prefix;

    private java.util.Locale locale;

    protected Detail detail = null;

    public SOAPFault(String namespace, String localName, String prefix, Attributes attrs, DeserializationContext context) throws AxisFault {
        super(namespace, localName, prefix, attrs, context);
    }

    public SOAPFault(AxisFault fault) {
        this.fault = fault;
    }

    public void outputImpl(SerializationContext context) throws Exception {
        SOAPConstants soapConstants = context.getMessageContext() == null ? SOAPConstants.SOAP11_CONSTANTS : context.getMessageContext().getSOAPConstants();
        namespaceURI = soapConstants.getEnvelopeURI();
        name = Constants.ELEM_FAULT;
        context.registerPrefixForURI(prefix, soapConstants.getEnvelopeURI());
        context.startElement(new QName(this.getNamespaceURI(), this.getName()), attributes);
        // XXX - Can fault be anything but an AxisFault here?
        if (fault instanceof AxisFault) {
            AxisFault axisFault = fault;
            if (axisFault.getFaultCode() != null) {
                // Do this BEFORE starting the element, so the prefix gets
                // registered if needed.
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
                    String faultCode = context.qName2String(axisFault.getFaultCode());
                    context.startElement(Constants.QNAME_FAULTCODE_SOAP12, null);
                    context.startElement(Constants.QNAME_FAULTVALUE_SOAP12, null);
                    context.writeSafeString(faultCode);
                    context.endElement();
                    QName[] subcodes = axisFault.getFaultSubCodes();
                    if (subcodes != null) {
                        for (int i = 0; i < subcodes.length; i++) {
                            faultCode = context.qName2String(subcodes[i]);
                            context.startElement(Constants.QNAME_FAULTSUBCODE_SOAP12, null);
                            context.startElement(Constants.QNAME_FAULTVALUE_SOAP12, null);
                            context.writeSafeString(faultCode);
                            context.endElement();
                        }
                        for (int i = 0; i < subcodes.length; i++) context.endElement();
                    }
                    context.endElement();
                } else {
                    String faultCode = context.qName2String(axisFault.getFaultCode());
                    context.startElement(Constants.QNAME_FAULTCODE, null);
                    context.writeSafeString(faultCode);
                    context.endElement();
                }
            }
            if (axisFault.getFaultString() != null) {
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
                    context.startElement(Constants.QNAME_FAULTREASON_SOAP12, null);
                    AttributesImpl attrs = new AttributesImpl();
                    attrs.addAttribute("http://www.w3.org/XML/1998/namespace", "lang", "xml:lang", "CDATA", "en");
                    context.startElement(Constants.QNAME_TEXT_SOAP12, attrs);
                } else
                    context.startElement(Constants.QNAME_FAULTSTRING, null);
                context.writeSafeString(axisFault.getFaultString());
                context.endElement();
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
                    context.endElement();
                }
            }
            if (axisFault.getFaultActor() != null) {
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
                    context.startElement(Constants.QNAME_FAULTROLE_SOAP12, null);
                else
                    context.startElement(Constants.QNAME_FAULTACTOR, null);
                context.writeSafeString(axisFault.getFaultActor());
                context.endElement();
            }
            if (axisFault.getFaultNode() != null) {
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
                    context.startElement(Constants.QNAME_FAULTNODE_SOAP12, null);
                    context.writeSafeString(axisFault.getFaultNode());
                    context.endElement();
                }
            }
            // get the QName for this faults detail element
            QName qname = getFaultQName(fault.getClreplaced(), context);
            if (qname == null && fault.detail != null) {
                qname = getFaultQName(fault.detail.getClreplaced(), context);
            }
            if (qname == null) {
                // not the greatest, but...
                qname = new QName("", "faultData");
            }
            Element[] faultDetails = axisFault.getFaultDetails();
            if (faultDetails != null) {
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
                    context.startElement(Constants.QNAME_FAULTDETAIL_SOAP12, null);
                else
                    context.startElement(Constants.QNAME_FAULTDETAILS, null);
                // Allow the fault to write its data, if any
                axisFault.writeDetails(qname, context);
                // Then output any other elements
                for (int i = 0; i < faultDetails.length; i++) {
                    context.writeDOMElement(faultDetails[i]);
                }
                if (detail != null) {
                    for (Iterator it = detail.getChildren().iterator(); it.hasNext(); ) {
                        ((NodeImpl) it.next()).output(context);
                    }
                }
                context.endElement();
            }
        }
        context.endElement();
    }

    private QName getFaultQName(Clreplaced cls, SerializationContext context) {
        QName qname = null;
        if (!cls.equals(AxisFault.clreplaced)) {
            FaultDesc faultDesc = null;
            if (context.getMessageContext() != null) {
                OperationDesc op = context.getMessageContext().getOperation();
                if (op != null) {
                    faultDesc = op.getFaultByClreplaced(cls);
                }
            }
            if (faultDesc != null) {
                qname = faultDesc.getQName();
            }
        }
        return qname;
    }

    public AxisFault getFault() {
        return fault;
    }

    public void setFault(AxisFault fault) {
        this.fault = fault;
    }

    /**
     * Sets this <CODE>SOAPFaultException</CODE> object with the given
     *   fault code.
     *
     *   <P>Fault codes, which given information about the fault,
     *   are defined in the SOAP 1.1 specification.</P>
     * @param   faultCode a <CODE>String</CODE> giving
     *     the fault code to be set; must be one of the fault codes
     *     defined in the SOAP 1.1 specification
     * @throws  SOAPException if there was an error in
     *     adding the <CODE>faultCode</CODE> to the underlying XML
     *     tree.
     */
    public void setFaultCode(String faultCode) throws SOAPException {
        fault.setFaultCodereplacedtring(faultCode);
    }

    /**
     * Gets the fault code for this <CODE>SOAPFaultException</CODE>
     * object.
     * @return a <CODE>String</CODE> with the fault code
     */
    public String getFaultCode() {
        return fault.getFaultCode().getLocalPart();
    }

    /**
     *  Sets this <CODE>SOAPFaultException</CODE> object with the given
     *   fault actor.
     *
     *   <P>The fault actor is the recipient in the message path who
     *   caused the fault to happen.</P>
     * @param   faultActor a <CODE>String</CODE>
     *     identifying the actor that caused this <CODE>
     *     SOAPFaultException</CODE> object
     * @throws  SOAPException  if there was an error in
     *     adding the <CODE>faultActor</CODE> to the underlying XML
     *     tree.
     */
    public void setFaultActor(String faultActor) throws SOAPException {
        fault.setFaultActor(faultActor);
    }

    /**
     * Gets the fault actor for this <CODE>SOAPFaultException</CODE>
     * object.
     * @return  a <CODE>String</CODE> giving the actor in the message
     *     path that caused this <CODE>SOAPFaultException</CODE> object
     * @see #setFaultActor(java.lang.String) setFaultActor(java.lang.String)
     */
    public String getFaultActor() {
        return fault.getFaultActor();
    }

    /**
     * Sets the fault string for this <CODE>SOAPFaultException</CODE>
     * object to the given string.
     *
     * @param faultString a <CODE>String</CODE>
     *     giving an explanation of the fault
     * @throws  SOAPException  if there was an error in
     *     adding the <CODE>faultString</CODE> to the underlying XML
     *     tree.
     * @see #getFaultString() getFaultString()
     */
    public void setFaultString(String faultString) throws SOAPException {
        fault.setFaultString(faultString);
    }

    /**
     * Gets the fault string for this <CODE>SOAPFaultException</CODE>
     * object.
     * @return a <CODE>String</CODE> giving an explanation of the
     *     fault
     */
    public String getFaultString() {
        return fault.getFaultString();
    }

    /**
     * Returns the detail element for this <CODE>SOAPFaultException</CODE>
     *   object.
     *
     *   <P>A <CODE>Detail</CODE> object carries
     *   application-specific error information related to <CODE>
     *   SOAPBodyElement</CODE> objects.</P>
     * @return  a <CODE>Detail</CODE> object with
     *     application-specific error information
     */
    public javax.xml.soap.Detail getDetail() {
        List children = this.getChildren();
        if (children == null || children.size() <= 0)
            return null;
        // find detail element
        for (int i = 0; i < children.size(); i++) {
            Object obj = children.get(i);
            if (obj instanceof javax.xml.soap.Detail) {
                return (javax.xml.soap.Detail) obj;
            }
        }
        return null;
    }

    /**
     * Creates a <CODE>Detail</CODE> object and sets it as the
     *   <CODE>Detail</CODE> object for this <CODE>SOAPFaultException</CODE>
     *   object.
     *
     *   <P>It is illegal to add a detail when the fault already
     *   contains a detail. Therefore, this method should be called
     *   only after the existing detail has been removed.</P>
     * @return the new <CODE>Detail</CODE> object
     * @throws  SOAPException  if this
     *     <CODE>SOAPFaultException</CODE> object already contains a valid
     *     <CODE>Detail</CODE> object
     */
    public javax.xml.soap.Detail addDetail() throws SOAPException {
        if (getDetail() != null) {
            throw new SOAPException(Messages.getMessage("valuePresent"));
        }
        Detail detail = convertToDetail(fault);
        addChildElement(detail);
        return detail;
    }

    public void setFaultCode(Name faultCodeQName) throws SOAPException {
        String uri = faultCodeQName.getURI();
        String local = faultCodeQName.getLocalName();
        String prefix = faultCodeQName.getPrefix();
        this.prefix = prefix;
        QName qname = new QName(uri, local);
        fault.setFaultCode(qname);
    }

    public Name getFaultCodeAsName() {
        QName qname = fault.getFaultCode();
        String uri = qname.getNamespaceURI();
        String local = qname.getLocalPart();
        return new PrefixedQName(uri, local, prefix);
    }

    public void setFaultString(String faultString, Locale locale) throws SOAPException {
        fault.setFaultString(faultString);
        this.locale = locale;
    }

    public Locale getFaultStringLocale() {
        return locale;
    }

    /**
     * Convert the details in an AxisFault to a Detail object
     *
     * @param fault source of the fault details
     * @return a detail element contructed from the AxisFault details
     * @throws SOAPException
     */
    private Detail convertToDetail(AxisFault fault) throws SOAPException {
        detail = new Detail();
        Element[] darray = fault.getFaultDetails();
        fault.setFaultDetail(new Element[] {});
        for (int i = 0; i < darray.length; i++) {
            Element detailtEntryElem = darray[i];
            DetailEntry detailEntry = detail.addDetailEntry(new PrefixedQName(detailtEntryElem.getNamespaceURI(), detailtEntryElem.getLocalName(), detailtEntryElem.getPrefix()));
            copyChildren(detailEntry, detailtEntryElem);
        }
        return detail;
    }

    /**
     * Copy the children of a DOM element to a SOAPElement.
     *
     * @param soapElement target of the copy
     * @param domElement source for the copy
     * @throws SOAPException
     */
    private static void copyChildren(SOAPElement soapElement, Element domElement) throws SOAPException {
        org.w3c.dom.NodeList nl = domElement.getChildNodes();
        for (int j = 0; j < nl.getLength(); j++) {
            org.w3c.dom.Node childNode = nl.item(j);
            if (childNode.getNodeType() == Node.TEXT_NODE) {
                soapElement.addTextNode(childNode.getNodeValue());
                // only one text node replacedmed
                break;
            }
            if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                String uri = childNode.getNamespaceURI();
                SOAPElement childSoapElement = null;
                if (uri == null) {
                    childSoapElement = soapElement.addChildElement(childNode.getLocalName());
                } else {
                    childSoapElement = soapElement.addChildElement(childNode.getLocalName(), childNode.getPrefix(), uri);
                }
                copyChildren(childSoapElement, (Element) childNode);
            }
        }
    }
}

18 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * test that making an axis fault from an axis fault retains it
 */
public void testAxisFaultFillIn() {
    AxisFault af1 = new AxisFault("fault1");
    AxisFault af2 = AxisFault.makeFault(af1);
    replacedertSame(af1, af2);
}

18 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * helper method to stick in when diagnosing stuff
 * @param af
 */
private void dumpFault(AxisFault af) {
    String s = af.dumpToString();
    System.out.println(s);
}

18 View Complete Implementation : TestSOAPFaultException.java
Copyright Apache License 2.0
Author : apache
/**
 * Tests if SOAP fault details are preplaceded to AxisFault objects
 */
public void testDetails() {
    SOAPFaultException soapFaultException = new SOAPFaultException(QNAME_FAULT_SERVER_USER, "MyFaultString", "http://myactor", getTestDetail());
    AxisFault axisFault = AxisFault.makeFault(soapFaultException);
    replacedertNotNull(axisFault.getFaultDetails());
    checkDetailAgainstTestDetail(axisFault);
}

18 View Complete Implementation : TestDynamicInvoker.java
Copyright Apache License 2.0
Author : apache
public void test4() throws Exception {
    try {
        String[] args = new String[] { "http://samples.gotdotnet.com/quickstart/aspplus/samples/services/MathService/VB/MathService.asmx?WSDL", "Add", "3", "4" };
        DynamicInvoker.main(args);
    } catch (java.net.ConnectException ce) {
        System.err.println("MathService connect error: " + ce);
        return;
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.detail instanceof InterruptedIOException || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("MathService HTTP error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    } catch (java.io.IOException ioe) {
        System.err.println("MathService connect error: " + ioe);
        return;
    }
}

18 View Complete Implementation : TestDynamicInvoker.java
Copyright Apache License 2.0
Author : apache
public void test3() throws Exception {
    try {
        String[] args = new String[] { "http://mssoapinterop.org/asmx/xsd/round4XSD.wsdl", "echoString(Round4XSDTestSoap)", "Hello World!!!" };
        DynamicInvoker.main(args);
    } catch (java.net.ConnectException ce) {
        System.err.println("round4XSD connect error: " + ce);
        return;
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.detail instanceof InterruptedIOException || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("round4XSD HTTP error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    } catch (java.io.IOException ioe) {
        System.err.println("round4XSD connect error: " + ioe);
        return;
    }
}

18 View Complete Implementation : HeaderBuilder.java
Copyright Apache License 2.0
Author : apache
public void startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException {
    SOAPConstants soapConstants = context.getSOAPConstants();
    if (soapConstants == SOAPConstants.SOAP12_CONSTANTS && attributes.getValue(Constants.URI_SOAP12_ENV, Constants.ATTR_ENCODING_STYLE) != null) {
        AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, null, Messages.getMessage("noEncodingStyleAttrAppear", "Header"), null, null, null);
        throw new SAXException(fault);
    }
    if (!context.isDoneParsing()) {
        if (myElement == null) {
            try {
                myElement = new SOAPHeader(namespace, localName, prefix, attributes, context, envelope.getSOAPConstants());
            } catch (AxisFault axisFault) {
                throw new SAXException(axisFault);
            }
            envelope.setHeader((SOAPHeader) myElement);
        }
        context.pushNewElement(myElement);
    }
}

18 View Complete Implementation : TestDynamicInvoker.java
Copyright Apache License 2.0
Author : apache
// ctor
public void test1() throws Exception {
    try {
        String[] args = new String[] { "http://www.xmethods.net/sd/2001/TemperatureService.wsdl", "getTemp", "02067" };
        DynamicInvoker.main(args);
    } catch (java.net.ConnectException ce) {
        System.err.println("getTemp connect error: " + ce);
        return;
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.detail instanceof InterruptedIOException || (fault.getFaultString().indexOf("Connection timed out") != -1) || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("getTemp HTTP error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    } catch (java.io.IOException ioe) {
        System.err.println("getTemp connect error: " + ioe);
        return;
    }
}

18 View Complete Implementation : TestDynamicInvoker.java
Copyright Apache License 2.0
Author : apache
public void test2() throws Exception {
    try {
        String[] args = new String[] { "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl", "getQuote", "IBM" };
        DynamicInvoker.main(args);
    } catch (java.net.ConnectException ce) {
        System.err.println("getQuote connect error: " + ce);
        return;
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.detail instanceof InterruptedIOException || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("getQuote HTTP error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    } catch (java.io.IOException ioe) {
        System.err.println("getQuote connect error: " + ioe);
        return;
    }
}

18 View Complete Implementation : AbstractGetPageActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Get page number from incoming soap request.
 *
 * @param params
 * @param doreplacedent
 * @return
 * @throws RemoteException
 * @throws ReportServiceException
 */
protected long getPageNumber(HttpServletRequest request, Oprand[] params, String doreplacedentName) throws RemoteException, ReportServiceException {
    long pageNumber = -1;
    if (params != null && params.length > 0) {
        for (int i = 0; i < params.length; i++) {
            if (IBirtConstants.OPRAND_PAGENO.equalsIgnoreCase(params[i].getName())) {
                try {
                    pageNumber = Integer.parseInt(params[i].getValue());
                } catch (NumberFormatException e) {
                    AxisFault fault = new AxisFault();
                    fault.setFaultCode(new QName(// $NON-NLS-1$
                    "DoreplacedentProcessor.getPageNumber( )"));
                    fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_PAGE_NUMBER_PARSE_ERROR, new Object[] { params[i].getValue() }));
                    throw fault;
                }
                if (pageNumber <= 0 || pageNumber > __totalPageNumber) {
                    AxisFault fault = new AxisFault();
                    fault.setFaultCode(new QName(// $NON-NLS-1$
                    "DoreplacedentProcessor.getPageNumber( )"));
                    fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_PAGE_NUMBER, new Object[] { Long.valueOf(pageNumber), Long.valueOf(__totalPageNumber) }));
                    throw fault;
                }
                break;
            }
        }
    }
    return pageNumber;
}

18 View Complete Implementation : DataServiceTestCase.java
Copyright Apache License 2.0
Author : apache
public void test1DataServiceSoapGetreplacedleAuthors() throws Exception {
    test.wsdl.dataset.DataServiceSoapStub binding;
    try {
        binding = (test.wsdl.dataset.DataServiceSoapStub) new test.wsdl.dataset.DataServiceLocator().getDataServiceSoap();
    } catch (javax.xml.rpc.ServiceException jre) {
        if (jre.getLinkedCause() != null)
            jre.getLinkedCause().printStackTrace();
        throw new junit.framework.replacedertionFailedError("JAX-RPC ServiceException caught: " + jre);
    }
    replacedertTrue("binding is null", binding != null);
    binding.setTimeout(60000);
    try {
        // Test operation
        test.wsdl.dataset.GetreplacedleAuthorsResponseGetreplacedleAuthorsResult value = null;
        value = binding.getreplacedleAuthors();
        replacedertTrue(value != null);
    // TBD - validate results
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("DataService HTTP error: " + fault);
                return;
            }
            if (fault.detail instanceof IOException) {
                System.err.println("DataService IO error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    }
}

18 View Complete Implementation : SOAPBody.java
Copyright Apache License 2.0
Author : apache
public javax.xml.soap.SOAPFault addFault(Name name, String s, Locale locale) throws SOAPException {
    AxisFault af = new AxisFault(new QName(name.getURI(), name.getLocalName()), s, "", new Element[0]);
    SOAPFault fault = new SOAPFault(af);
    addChildElement(fault);
    return fault;
}

18 View Complete Implementation : BirtGetTOCActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Implement to check if doreplacedent file exists
 *
 * @throws RemoteException
 */
protected void __checkDoreplacedentExists() throws RemoteException {
    File file = new File(__docName);
    if (!file.exists()) {
        // if doreplacedent file doesn't exist, throw exception
        AxisFault fault = new AxisFault();
        fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_DOreplacedENT_FILE_NO_EXIST));
        throw fault;
    }
}

18 View Complete Implementation : SOAPBody.java
Copyright Apache License 2.0
Author : apache
public javax.xml.soap.SOAPFault addFault(Name name, String s) throws SOAPException {
    AxisFault af = new AxisFault(new QName(name.getURI(), name.getLocalName()), s, "", new Element[0]);
    SOAPFault fault = new SOAPFault(af);
    addChildElement(fault);
    return fault;
}

18 View Complete Implementation : BirtUtility.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Creates an axis fault based on a given exception.
 *
 * @param qName
 *            QName of the fault
 * @param e
 *            exception
 * @return axis fault
 */
public static AxisFault makeAxisFault(String qName, Exception e) {
    AxisFault fault = makeAxisFault(e);
    fault.setFaultCode(new QName(qName));
    return fault;
}

18 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * verify we can properly lookup empty namespace stuff
 */
public void testEmptyNamespaceLookup() {
    AxisFault af = new AxisFault();
    af.addFaultDetailString("alles geht gut");
    Element match = af.lookupFaultDetail(new QName(null, "string"));
    replacedertNotNull(match);
}

18 View Complete Implementation : SOAPFaultBuilder.java
Copyright Apache License 2.0
Author : apache
public void startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException {
    SOAPConstants soapConstants = context.getSOAPConstants();
    if (soapConstants == SOAPConstants.SOAP12_CONSTANTS && attributes.getValue(Constants.URI_SOAP12_ENV, Constants.ATTR_ENCODING_STYLE) != null) {
        AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, null, Messages.getMessage("noEncodingStyleAttrAppear", "Fault"), null, null, null);
        throw new SAXException(fault);
    }
    super.startElement(namespace, localName, prefix, attributes, context);
}

18 View Complete Implementation : QSWSDLHandler.java
Copyright Apache License 2.0
Author : apache
/**
 * Report that we have no WSDL.
 *
 * @param res
 * @param writer
 * @param moreDetailCode optional name of a message to provide more detail
 * @param axisFault      optional fault string, for extra info at debug time only
 */
public void reportNoWSDL(HttpServletResponse res, PrintWriter writer, String moreDetailCode, AxisFault axisFault) {
    res.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
    res.setContentType("text/html");
    writer.println("<h2>" + Messages.getMessage("error00") + "</h2>");
    writer.println("<p>" + Messages.getMessage("noWSDL00") + "</p>");
    if (moreDetailCode != null) {
        writer.println("<p>" + Messages.getMessage(moreDetailCode) + "</p>");
    }
    if (axisFault != null && isDevelopment()) {
        // only dev systems give fault dumps
        writeFault(writer, axisFault);
    }
}

17 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
public void testArrayAddWorks() {
    AxisFault af = new AxisFault();
    af.addFaultDetailString("alles geht gut");
    Element[] array = new Element[2];
    array[0] = createElement("ein", "un");
    array[1] = createElement("zwei", "deux");
    af.setFaultDetail(array);
    Element match = af.lookupFaultDetail(new QName(null, "zwei"));
    replacedertNotNull(match);
    Element old = af.lookupFaultDetail(new QName(null, "string"));
    replacedertNull(old);
}

17 View Complete Implementation : TestSOAPFaultException.java
Copyright Apache License 2.0
Author : apache
/**
 * Tests if an AxisFault is initialized with the values from a SOAPFaultException
 */
public void testMakeFaultOutOfSOAPFaultException() {
    QName faultcode = new QName(soapConsts.getEnvelopeURI(), "Server.MySubClreplaced");
    SOAPFaultException soapFaultException = new SOAPFaultException(faultcode, "MyFaultString", "http://myactor", null);
    AxisFault axisFault = AxisFault.makeFault(soapFaultException);
    replacedertEquals(faultcode, axisFault.getFaultCode());
}

17 View Complete Implementation : TestSOAPFaultException.java
Copyright Apache License 2.0
Author : apache
/**
 * Tests the defaults generated from a SOAPFaultException
 */
public void testDefaults() {
    SOAPFaultException soapFaultException = new SOAPFaultException(null, null, null, null);
    AxisFault axisFault = AxisFault.makeFault(soapFaultException);
    replacedertEquals(QNAME_FAULT_SERVER_USER, axisFault.getFaultCode());
    replacedertNotNull(axisFault.getFaultString());
}

17 View Complete Implementation : WhiteMesaSoap12AddTestSvcTestCase.java
Copyright Apache License 2.0
Author : apache
public void testXMLP7() throws Exception {
    URL url = new URL(DOC_ENDPOINT);
    test.wsdl.soap12.additional.Soap12AddTestDocBindingStub binding;
    try {
        binding = (test.wsdl.soap12.additional.Soap12AddTestDocBindingStub) new test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocPort(url);
    } catch (javax.xml.rpc.ServiceException jre) {
        if (jre.getLinkedCause() != null)
            jre.getLinkedCause().printStackTrace();
        throw new junit.framework.replacedertionFailedError("JAX-RPC ServiceException caught: " + jre);
    }
    replacedertNotNull("binding is null", binding);
    // Time out after a minute
    binding.setTimeout(60000);
    // Test operation
    try {
        binding.echoSenderFault(STRING_VAL);
    } catch (java.rmi.RemoteException e) {
        if (e instanceof AxisFault) {
            AxisFault af = (AxisFault) e;
            replacedertEquals(Constants.FAULT_SOAP12_SENDER, af.getFaultCode());
            // success
            return;
        }
    }
    fail("Should have received sender fault!");
}

17 View Complete Implementation : AbstractGetPageActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Prepare parameters
 *
 * @throws Exception
 * @throws RemoteException
 */
protected void prepareParameters() throws Exception, RemoteException {
    __bean = (ViewerAttributeBean) context.getBean();
    __docName = __getReportDoreplacedent();
    __checkDoreplacedentExists();
    if (ParameterAccessor.isGetReportlet(context.getRequest())) {
        // Reportlet doesn't support pagination
        __totalPageNumber = 1;
    } else {
        // Get total page count.
        InputOptions getPageCountOptions = new InputOptions();
        getPageCountOptions.setOption(InputOptions.OPT_LOCALE, __bean.getLocale());
        getPageCountOptions.setOption(InputOptions.OPT_TIMEZONE, __bean.getTimeZone());
        getPageCountOptions.setOption(InputOptions.OPT_REQUEST, context.getRequest());
        OutputOptions outputOptions = new OutputOptions();
        __totalPageNumber = getReportService().getPageCount(__docName, getPageCountOptions, outputOptions);
        Boolean isCompleted = (Boolean) outputOptions.getOption(OutputOptions.OPT_REPORT_GENERATION_COMPLETED);
        if (isCompleted != null) {
            __isCompleted = isCompleted.booleanValue();
        }
    }
    __pageNumber = getPageNumber(context.getRequest(), operation.getOprand(), __docName);
    // No valid page number check bookmark from soap message.
    if (!isValidPageNumber(context.getRequest(), __pageNumber, __docName)) {
        __bookmark = getBookmark(operation.getOprand(), __bean);
        if (__bookmark != null && __bookmark.length() > 0) {
            InputOptions options = new InputOptions();
            options.setOption(InputOptions.OPT_REQUEST, context.getRequest());
            options.setOption(InputOptions.OPT_LOCALE, __bean.getLocale());
            // Bookmark is a TOC name, then find TOC id by name
            if (isToc(operation.getOprand(), __bean)) {
                __bookmark = (getReportService()).findTocByName(__docName, __bookmark, options);
            }
            __pageNumber = getReportService().getPageNumberByBookmark(__docName, __bookmark, options);
            if (!isValidPageNumber(context.getRequest(), __pageNumber, __docName)) {
                AxisFault fault = new AxisFault();
                fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_BOOKMARK, new String[] { getBookmark(operation.getOprand(), __bean) }));
                throw fault;
            }
            __useBookmark = true;
        }
    }
    // Verify the page number again.
    if (!isValidPageNumber(context.getRequest(), __pageNumber, __docName)) {
        AxisFault fault = new AxisFault();
        fault.setFaultReason(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_PAGE_NUMBER, new Object[] { Long.valueOf(__pageNumber), Long.valueOf(__totalPageNumber) }));
        throw fault;
    }
    __svgFlag = getSVGFlag(operation.getOprand());
}

17 View Complete Implementation : BirtUtility.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Creates an axis fault based on a given exception.
 *
 * @param qName
 *            QName of the fault
 * @param e
 *            exception
 * @return axis fault
 */
public static AxisFault makeAxisFault(Exception e) {
    if (e instanceof AxisFault) {
        return (AxisFault) e;
    } else {
        AxisFault fault = AxisFault.makeFault(e);
        fault.addFaultDetailString(BirtUtility.getStackTrace(e));
        return fault;
    }
}

17 View Complete Implementation : SOAPFaultDetailsBuilder.java
Copyright Apache License 2.0
Author : apache
public void startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException {
    SOAPConstants soapConstants = context.getSOAPConstants();
    if (soapConstants == SOAPConstants.SOAP12_CONSTANTS && attributes.getValue(Constants.URI_SOAP12_ENV, Constants.ATTR_ENCODING_STYLE) != null) {
        AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, null, Messages.getMessage("noEncodingStyleAttrAppear", "Detail"), null, null, null);
        throw new SAXException(fault);
    }
    super.startElement(namespace, localName, prefix, attributes, context);
}

17 View Complete Implementation : AbstractQueryStringHandler.java
Copyright Apache License 2.0
Author : apache
/**
 * turn any Exception into an AxisFault, log it, set the response
 * status code according to what the specifications say and
 * return a response message for posting. This will be the response
 * message preplaceded in if non-null; one generated from the fault otherwise.
 *
 * @param exception what went wrong
 * @param responseMsg what response we have (if any)
 * @return a response message to send to the user
 */
protected Message convertExceptionToAxisFault(Exception exception, Message responseMsg) {
    logException(exception);
    if (responseMsg == null) {
        AxisFault fault = AxisFault.makeFault(exception);
        processAxisFault(fault);
        responseMsg = new Message(fault);
    }
    return responseMsg;
}

17 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * test that exceptions are filled in
 */
public void testExceptionFillIn() {
    Exception e = new Exception("foo");
    AxisFault af = AxisFault.makeFault(e);
    Element stackTrace;
    stackTrace = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
    replacedertNotNull(stackTrace);
    Element exceptionName;
    exceptionName = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME);
    replacedertNull(exceptionName);
    QName faultCode = af.getFaultCode();
    replacedertEquals(faultCode.getLocalPart(), Constants.FAULT_SERVER_USER);
}

17 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
public void testEmptyArrayAddWorks() {
    AxisFault af = new AxisFault();
    af.addFaultDetailString("alles geht gut");
    Element[] array = new Element[0];
    af.setFaultDetail(array);
    Element old = af.lookupFaultDetail(new QName(null, "string"));
    replacedertNull(old);
}

16 View Complete Implementation : BodyBuilder.java
Copyright Apache License 2.0
Author : apache
public void startElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context) throws SAXException {
    SOAPConstants soapConstants = context.getSOAPConstants();
    if (soapConstants == SOAPConstants.SOAP12_CONSTANTS && attributes.getValue(Constants.URI_SOAP12_ENV, Constants.ATTR_ENCODING_STYLE) != null) {
        AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, null, Messages.getMessage("noEncodingStyleAttrAppear", "Body"), null, null, null);
        throw new SAXException(fault);
    }
    // make a new body element
    if (!context.isDoneParsing()) {
        if (!context.isProcessingRef()) {
            if (myElement == null) {
                try {
                    myElement = new SOAPBody(namespace, localName, prefix, attributes, context, envelope.getSOAPConstants());
                } catch (AxisFault axisFault) {
                    throw new SAXException(axisFault);
                }
            }
            context.pushNewElement(myElement);
        }
        envelope.setBody((SOAPBody) myElement);
    }
}

16 View Complete Implementation : SOAPFault.java
Copyright Apache License 2.0
Author : apache
/**
 * Convert the details in an AxisFault to a Detail object
 *
 * @param fault source of the fault details
 * @return a detail element contructed from the AxisFault details
 * @throws SOAPException
 */
private Detail convertToDetail(AxisFault fault) throws SOAPException {
    detail = new Detail();
    Element[] darray = fault.getFaultDetails();
    fault.setFaultDetail(new Element[] {});
    for (int i = 0; i < darray.length; i++) {
        Element detailtEntryElem = darray[i];
        DetailEntry detailEntry = detail.addDetailEntry(new PrefixedQName(detailtEntryElem.getNamespaceURI(), detailtEntryElem.getLocalName(), detailtEntryElem.getPrefix()));
        copyChildren(detailEntry, detailtEntryElem);
    }
    return detail;
}

16 View Complete Implementation : AbstractQueryStringHandler.java
Copyright Apache License 2.0
Author : apache
/**
 * Configure the servlet response status code and maybe other headers
 * from the fault info.
 * @param response response to configure
 * @param fault what went wrong
 */
protected void configureResponseFromAxisFault(HttpServletResponse response, AxisFault fault) {
    // then get the status code
    // It's been suggested that a lack of SOAPAction
    // should produce some other error code (in the 400s)...
    int status = getHttpServletResponseStatus(fault);
    if (status == HttpServletResponse.SC_UNAUTHORIZED) {
        // unauth access results in authentication request
        // TODO: less generic realm choice?
        response.setHeader("WWW-Authenticate", "Basic realm=\"AXIS\"");
    }
    response.setStatus(status);
}

16 View Complete Implementation : TestAxisFault.java
Copyright Apache License 2.0
Author : apache
/**
 * test we can remove some detail
 */
public void testDetailRemoval() {
    Exception e = new Exception("foo");
    AxisFault af = AxisFault.makeFault(e);
    replacedertTrue(af.removeFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE));
    Element stackTrace;
    stackTrace = af.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
    replacedertNull(stackTrace);
    String text = af.getFaultString();
    replacedertNotNull(text);
    text = af.toString();
    replacedertNotNull(text);
}

16 View Complete Implementation : TestSOAPFault.java
Copyright Apache License 2.0
Author : apache
/**
 * Regression test for AXIS-2705. The issue occurs when a SOAP fault has a detail element
 * containing text (and not elements). Note that such a SOAP fault violates the SOAP spec, but
 * Axis should nevertheless be able to process it.
 *
 * @throws Exception
 */
public void testAxis2705() throws Exception {
    InputStream in = TestSOAPFault.clreplaced.getResourcereplacedtream("AXIS-2705.xml");
    try {
        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage(null, in);
        SOAPBody body = msg.getSOAPPart().getEnvelope().getBody();
        replacedertTrue(body.hasFault());
        SOAPFault fault = body.getFault();
        AxisFault axisFault = ((org.apache.axis.message.SOAPFault) fault).getFault();
        Element[] details = axisFault.getFaultDetails();
        replacedertEquals(1, details.length);
        Element detailElement = details[0];
        replacedertEquals("text", detailElement.getTagName());
    } finally {
        in.close();
    }
}

16 View Complete Implementation : TestHeaderAttrs.java
Copyright Apache License 2.0
Author : apache
/**
 * Test an unrecognized header with MustUnderstand="true"
 */
public void testMUBadHeader() throws Exception {
    // 1. MU header to unrecognized actor -> should work fine
    badHeader.setActor(ACTOR);
    badHeader.setMustUnderstand(true);
    replacedertTrue("Bad result from test", runTest(badHeader, false));
    // 2. MU header to NEXT -> should fail
    badHeader.setActor(soapVersion.getNextRoleURI());
    badHeader.setMustUnderstand(true);
    // Test (should produce MU failure)
    try {
        runTest(badHeader, false);
    } catch (Exception e) {
        replacedertTrue("Non AxisFault Exception : " + e, e instanceof AxisFault);
        AxisFault fault = (AxisFault) e;
        replacedertEquals("Bad fault code!", soapVersion.getMustunderstandFaultQName(), fault.getFaultCode());
        return;
    }
    fail("Should have gotten mustUnderstand fault!");
}

16 View Complete Implementation : TestJAXRPCDII.java
Copyright Apache License 2.0
Author : apache
// ctor
public void test1() throws Exception {
    try {
        String wsdlLocation = "http://www.xmethods.net/sd/2001/TemperatureService.wsdl";
        String wsdlNsp = "http://www.xmethods.net/sd/TemperatureService.wsdl";
        ServiceFactory factory = ServiceFactory.newInstance();
        Service service = factory.createService(new URL(wsdlLocation), new QName(wsdlNsp, "TemperatureService"));
        Call[] calls = service.getCalls(new QName(wsdlNsp, "TemperaturePort"));
        replacedertTrue(calls != null);
        replacedertEquals(calls[0].getOperationName().getLocalPart(), "getTemp");
        ((org.apache.axis.client.Call) calls[0]).setTimeout(new Integer(15 * 1000));
        Object ret = calls[0].invoke(new Object[] { "02067" });
        System.out.println("Temperature:" + ret);
    } catch (java.rmi.RemoteException re) {
        if (re instanceof AxisFault) {
            AxisFault fault = (AxisFault) re;
            if (fault.detail instanceof ConnectException || fault.detail instanceof InterruptedIOException || (fault.getFaultString().indexOf("Connection timed out") != -1) || fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("getTemp HTTP error: " + fault);
                return;
            }
        }
        throw new junit.framework.replacedertionFailedError("Remote Exception caught: " + re);
    } catch (java.io.IOException ioe) {
        System.err.println("getTemp connect error: " + ioe);
        return;
    }
}

16 View Complete Implementation : HttpHandler.java
Copyright Apache License 2.0
Author : googleads
/**
 * Returns a new Axis Message based on the contents of the HTTP response.
 *
 * @param httpResponse the HTTP response
 * @return an Axis Message for the HTTP response
 * @throws IOException if unable to retrieve the HTTP response's contents
 * @throws AxisFault if the HTTP response's status or contents indicate an unexpected error, such
 *     as a 405.
 */
private Message createResponseMessage(HttpResponse httpResponse) throws IOException, AxisFault {
    int statusCode = httpResponse.getStatusCode();
    String contentType = httpResponse.getContentType();
    // The conditions below duplicate the logic in CommonsHTTPSender and HTTPSender.
    boolean shouldParseResponse = (statusCode > 199 && statusCode < 300) || (contentType != null && !contentType.equals("text/html") && statusCode > 499 && statusCode < 600);
    // Wrap the content input stream in a notifying stream so the stream event listener will be
    // notified when it is closed.
    InputStream responseInputStream = new NotifyingInputStream(httpResponse.getContent(), inputStreamEventListener);
    if (!shouldParseResponse) {
        // The contents are not an XML response, so throw an AxisFault with
        // the HTTP status code and message details.
        String statusMessage = httpResponse.getStatusMessage();
        AxisFault axisFault = new AxisFault("HTTP", "(" + statusCode + ")" + statusMessage, null, null);
        axisFault.addFaultDetail(Constants.QNAME_FAULTDETAIL_HTTPERRORCODE, String.valueOf(statusCode));
        try (InputStream stream = responseInputStream) {
            byte[] contentBytes = ByteStreams.toByteArray(stream);
            axisFault.setFaultDetailString(Messages.getMessage("return01", String.valueOf(statusCode), new String(contentBytes, UTF_8)));
        }
        throw axisFault;
    }
    // Response is an XML response. Do not consume and close the stream in this case, since that
    // will happen later when the response is deserialized by Axis (as confirmed by unit tests for
    // this clreplaced).
    Message responseMessage = new Message(responseInputStream, false, contentType, httpResponse.getHeaders().getLocation());
    responseMessage.setMessageType(Message.RESPONSE);
    return responseMessage;
}

15 View Complete Implementation : AbstractChangeParameterActionHandler.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Get page number from incoming soap request.
 *
 * @param params
 * @param doreplacedent
 * @return
 * @throws RemoteException
 * @throws ReportServiceException
 */
protected long getPageNumber(HttpServletRequest request, Oprand[] params, String doreplacedentName) throws RemoteException, ReportServiceException {
    long pageNumber = -1;
    if (params != null && params.length > 0) {
        for (int i = 0; i < params.length; i++) {
            if (IBirtConstants.OPRAND_PAGENO.equalsIgnoreCase(params[i].getName())) {
                try {
                    pageNumber = Integer.parseInt(params[i].getValue());
                } catch (NumberFormatException e) {
                    AxisFault fault = new AxisFault();
                    fault.setFaultCode(new QName(// $NON-NLS-1$
                    "DoreplacedentProcessor.getPageNumber( )"));
                    fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_PAGE_NUMBER_PARSE_ERROR, new Object[] { params[i].getValue() }));
                    throw fault;
                }
                InputOptions options = new InputOptions();
                options.setOption(InputOptions.OPT_REQUEST, request);
                long totalPageNumber = getReportService().getPageCount(doreplacedentName, options, new OutputOptions());
                if (pageNumber <= 0 || pageNumber > totalPageNumber) {
                    AxisFault fault = new AxisFault();
                    fault.setFaultCode(new QName(// $NON-NLS-1$
                    "DoreplacedentProcessor.getPageNumber( )"));
                    fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_PAGE_NUMBER, new Object[] { Long.valueOf(pageNumber), Long.valueOf(totalPageNumber) }));
                    throw fault;
                }
                break;
            }
        }
    }
    return pageNumber;
}

15 View Complete Implementation : AbstractBaseComponentProcessor.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Processor entry point. Generic processing.
 *
 * @param context
 * @param op
 * @param response
 * @throws RemoteException
 */
public void process(IContext context, Operation op, GetUpdatedObjectsResponse response) throws RemoteException {
    replacedert context != null;
    String operator = op.getOperator().toUpperCase();
    if (operator == null) {
        // TODO: need s common method for this.
        AxisFault fault = new AxisFault();
        fault.setFaultCode(new QName(this.getClreplaced().getName()));
        fault.setFaultString(BirtResources.getMessage(ResourceConstants.COMPONENT_PROCESSOR_EXCEPTION_MISSING_OPERATOR));
        throw fault;
    }
    Method method = (Method) getOpMap().get(operator);
    if (method != null) {
        try {
            method.invoke(this, new Object[] { context, op, response });
        } catch (InvocationTargetException e) {
            Exception target = (Exception) e.getTargetException();
            throw BirtUtility.makeAxisFault(target);
        } catch (Exception e) {
            // TODO: clear this out.
            AxisFault fault = new AxisFault();
            // $NON-NLS-1$
            fault.setFaultCode(new QName("Clear out this."));
            fault.setFaultString(e.getLocalizedMessage());
            throw fault;
        }
    }
}

15 View Complete Implementation : BirtUtility.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Creates an axis fault grouping the given exceptions list
 *
 * @param qName
 *            QName of the fault
 * @param exceptions
 *            list of exceptions
 * @return axis fault
 */
public static Exception makeAxisFault(String qName, Collection<Exception> exceptions) {
    if (exceptions.size() == 1) {
        return makeAxisFault(qName, exceptions.iterator().next());
    } else {
        QName exceptionQName = new QName("string");
        AxisFault fault = new AxisFault(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_MULTIPLE_EXCEPTIONS));
        fault.setFaultCode(new QName(qName));
        for (Iterator i = exceptions.iterator(); i.hasNext(); ) {
            Exception e = (Exception) i.next();
            fault.addFaultDetail(exceptionQName, getStackTrace(e));
        }
        return fault;
    }
}

14 View Complete Implementation : DeserializationContext.java
Copyright Apache License 2.0
Author : apache
/**
 * startElement is called when an element is read.  This is the big work-horse.
 *
 * This guy also handles monitoring the recording depth if we're recording
 * (so we know when to stop).
 */
public void startElement(String namespace, String localName, String qName, Attributes attributes) throws SAXException {
    if (debugEnabled) {
        log.debug("Enter: DeserializationContext::startElement(" + namespace + ", " + localName + ")");
    }
    if (attributes == null || attributes.getLength() == 0) {
        attributes = NullAttributes.singleton;
    } else {
        attributes = new AttributesImpl(attributes);
        SOAPConstants soapConstants = getSOAPConstants();
        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
            if (attributes.getValue(soapConstants.getAttrHref()) != null && attributes.getValue(Constants.ATTR_ID) != null) {
                AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, null, Messages.getMessage("noIDandHREFonSameElement"), null, null, null);
                throw new SAXException(fault);
            }
        }
    }
    SOAPHandler nextHandler = null;
    String prefix = "";
    int idx = qName.indexOf(':');
    if (idx > 0) {
        prefix = qName.substring(0, idx);
    }
    if (topHandler != null) {
        nextHandler = topHandler.onStartChild(namespace, localName, prefix, attributes, this);
    }
    if (nextHandler == null) {
        nextHandler = new SOAPHandler();
    }
    pushElementHandler(nextHandler);
    nextHandler.startElement(namespace, localName, prefix, attributes, this);
    if (!doneParsing && (recorder != null)) {
        recorder.startElement(namespace, localName, qName, attributes);
        if (!doneParsing) {
            curElement.setContentsIndex(recorder.getLength());
        }
    }
    if (startOfMappingsPos != -1) {
        startOfMappingsPos = -1;
    } else {
        // Push an empty frame if there are no mappings
        namespaces.push();
    }
    if (debugEnabled) {
        log.debug("Exit: DeserializationContext::startElement()");
    }
}

14 View Complete Implementation : SOAPFaultBuilder.java
Copyright Apache License 2.0
Author : apache
/**
 * When we're sure we have everything, this gets called.
 */
private void createFault() {
    AxisFault f = null;
    SOAPConstants soapConstants = context.getMessageContext() == null ? SOAPConstants.SOAP11_CONSTANTS : context.getMessageContext().getSOAPConstants();
    if (faultClreplaced != null) {
        // Custom fault handling
        try {
            // If we have an element which is fault data, It can be:
            // 1. A simple type that needs to be preplaceded in to the constructor
            // 2. A complex type that is the exception itself
            if (faultData != null) {
                if (faultData instanceof AxisFault) {
                    // This is our exception clreplaced
                    f = (AxisFault) faultData;
                } else {
                    // We need to create the exception,
                    // preplaceding the data to the constructor.
                    Clreplaced argClreplaced = ConvertWrapper(faultData.getClreplaced());
                    try {
                        Constructor con = faultClreplaced.getConstructor(new Clreplaced[] { argClreplaced });
                        f = (AxisFault) con.newInstance(new Object[] { faultData });
                    } catch (Exception e) {
                    // Don't do anything here, since a problem above means
                    // we'll just fall through and use a plain AxisFault.
                    }
                    if (f == null && faultData instanceof Exception) {
                        f = AxisFault.makeFault((Exception) faultData);
                    }
                }
            }
            // If we have an AxisFault, set the fields
            if (AxisFault.clreplaced.isreplacedignableFrom(faultClreplaced)) {
                if (f == null) {
                    // this is to support the <exceptionName> detail
                    f = (AxisFault) faultClreplaced.newInstance();
                }
                if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
                    f.setFaultCode(code.getFaultCode());
                    SOAPFaultCodeBuilder c = code;
                    while ((c = c.getNext()) != null) {
                        f.addFaultSubCode(c.getFaultCode());
                    }
                } else {
                    f.setFaultCode(faultCode);
                }
                f.setFaultString(faultString);
                f.setFaultActor(faultActor);
                f.setFaultNode(faultNode);
                f.setFaultDetail(faultDetails);
            }
        } catch (Exception e) {
        // Don't do anything here, since a problem above means
        // we'll just fall through and use a plain AxisFault.
        }
    }
    if (f == null) {
        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
            faultCode = code.getFaultCode();
            if (code.getNext() != null) {
                Vector v = new Vector();
                SOAPFaultCodeBuilder c = code;
                while ((c = c.getNext()) != null) v.add(c.getFaultCode());
                faultSubCode = (QName[]) v.toArray(new QName[v.size()]);
            }
        }
        f = new AxisFault(faultCode, faultSubCode, faultString, faultActor, faultNode, faultDetails);
        try {
            Vector headers = element.getEnvelope().getHeaders();
            for (int i = 0; i < headers.size(); i++) {
                SOAPHeaderElement header = (SOAPHeaderElement) headers.elementAt(i);
                f.addHeader(header);
            }
        } catch (AxisFault axisFault) {
        // What to do here?
        }
    }
    element.setFault(f);
}