Package org.jibx.runtime

Examples of org.jibx.runtime.QName


     * @throws WsException on any error reading the SOAP fault
     */
    public SoapFault startFault() throws WsException {
        try {
            m_wrapper.parsePastStartTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_FAULTNAME);
            QName code = createQName(m_wrapper.parseElementText("", SoapConstants.FAULTCODE_NAME));
            String fault = m_wrapper.parseElementText("", SoapConstants.FAULTSTRING_NAME);
            String actor = null;
            if (m_wrapper.isAtStart("", SoapConstants.FAULTACTOR_NAME)) {
                actor = m_wrapper.parseElementText("", SoapConstants.FAULTACTOR_NAME);
            }
View Full Code Here


        }
    }


    private QName createQName(String str) {
        QName qname = null;
        if (str != null) {
            int i = str.indexOf(':');
            if (i == -1) {
                qname = new QName(str);
            } else {
                String prefix = str.substring(0, i);
                String name = str.substring(i + 1);
                String uri = m_wrapper.getReader().getNamespace(prefix);
                qname = new QName(uri, prefix, name);
            }
        }
        return qname;
    }
View Full Code Here

     *
     * @throws Exception
     */
    public void testFaultCodeWithNoPrefix() throws Exception {
        try {
            QName faultCode = new QName("http://example.org/faultcodes", "ProcessingError");
            new SoapFault(faultCode, "An error occured while processing the message", null);
            fail("Expected WsException to be thrown if prefix is null");
        } catch (WsException e) {
            assertThat(e.getMessage(), is("faultCode prefix must be non-null for custom URIs"));
        }
View Full Code Here

     *
     * @throws Exception
     */
    public void testFaultCodeWithNoURI() throws Exception {
        try {
            QName faultCode = new QName("ProcessingError");
            new SoapFault(faultCode, "An error occured while processing the message", null);
            fail("Expected WsException to be thrown if URI is null");
        } catch (WsException e) {
            assertThat(e.getMessage(), is("faultCode URI must be non-null"));
        }
View Full Code Here

     * example SOAP fault provided the WS-I R1004 requirement.
     *
     * @throws Exception
     */
    public void testSendFaultMessageWithCustomFaultCode() throws Exception {
        QName faultCode = new QName("http://example.org/faultcodes", "c", "ProcessingError");
        SoapFault fault = new SoapFault(faultCode, "An error occured while processing the message", null);
        m_processor.sendFaultMessage(fault, StubbedChannel.getOutConnection());

        String expected = SoapMaker.envelope(SoapMaker.body(
                  "<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'\n"
View Full Code Here

     * Uses the example SOAP fault provided the WS-I R1004 requirement.
     *
     * @throws Exception
     */
    public void testSendFaultMessageWithCustomFaultCode() throws Exception {
        QName faultCode = new QName("http://example.org/faultcodes", "c", "ProcessingError");
        SoapFault fault = new SoapFault(faultCode, "An error occured while processing the message", null);
        m_OutInProcessor.sendFaultMessage(fault, StubbedChannel.getOutConnection());

        String expected = SoapMaker.envelope(SoapMaker.body(
                  "<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'\n"
View Full Code Here

//    }

     */
    public void testSendFaultMessageWithCustomFaultCodeWithNoPrefix() throws Exception {
        try {
            QName faultCode = new QName("http://example.org/faultcodes", "ProcessingError");
            new SoapFault(faultCode, "An error occured while processing the message", null);
            fail("Expected WsException to be thrown if prefix is null");
        } catch (WsException e) {
            assertTrue(true);
        }
View Full Code Here

     *
     * @throws Exception
     */
    public void testSendFaultMessageWithFaultCodeWithNoURI() throws Exception {
        try {
            QName faultCode = new QName("ProcessingError");
            new SoapFault(faultCode, "An error occured while processing the message", null);
            fail("Expected WsException to be thrown if URI is null");
        } catch (WsException e) {
            assertTrue(true);
        }
View Full Code Here

     * @param target
     */
    private void mergeMapNamespaced(String uri, HashMap source, HashMap target) {
        if (!source.isEmpty()) {
            for (Iterator iter = source.keySet().iterator(); iter.hasNext();) {
                QName oldname = (QName)iter.next();
                QName newname = new QName(uri, oldname.getName());
                target.put(newname, source.get(oldname));
            }
        }
    }
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.jibx.schema.SchemaVisitor#visit(org.jibx.schema.AttributeElement)
     */
    public boolean visit(AttributeElement node) {
        QName qname = node.getQName();
        if (qname != null) {
            m_context.registerAttribute(qname, node);
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.jibx.runtime.QName

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.