Package javax.xml.soap

Examples of javax.xml.soap.SOAPBody.addFault()


        MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        SOAPMessage soapMessage = fac.createMessage();
        SOAPPart soapPart = soapMessage.getSOAPPart();
        SOAPEnvelope envelope = soapPart.getEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPFault sf = body.addFault();
       
        String expected1 = "Its my fault";
        String expected2 = "Its my fault again";

        boolean found1 = false;
View Full Code Here


            SOAPPart soapPart = soapMessage.getSOAPPart();

            SOAPEnvelope envelope = soapPart.getEnvelope();
            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
            SOAPBody body = envelope.getBody();
            SOAPFault soapFault = body.addFault();
            soapFault.setFaultRole("test");
            soapMessage.saveChanges();

        } catch (SOAPException e) {
            fail("Unexpected Exception Occurred : " + e);
View Full Code Here

            SOAPPart soapPart = soapMessage.getSOAPPart();

            SOAPEnvelope envelope = soapPart.getEnvelope();
            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
            SOAPBody body = envelope.getBody();
            SOAPFault soapFault = body.addFault();
            soapFault.setFaultNode("test");
            soapMessage.saveChanges();

        } catch (SOAPException e) {
            fail("Unexpected Exception Occurred : " + e);
View Full Code Here

            SOAPPart soapPart = soapMessage.getSOAPPart();

            SOAPEnvelope envelope = soapPart.getEnvelope();
            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
            SOAPBody body = envelope.getBody();
            SOAPFault soapFault = body.addFault();
            soapFault.addFaultReasonText("myReason", new Locale("en"));
            soapFault.addFaultReasonText("de-myReason", new Locale("de"));
            soapFault.addFaultReasonText("si-myReason", new Locale("si"));
            soapMessage.saveChanges();
View Full Code Here

            SOAPPart soapPart = soapMessage.getSOAPPart();

            SOAPEnvelope envelope = soapPart.getEnvelope();
            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
            SOAPBody body = envelope.getBody();
            SOAPFault soapFault = body.addFault();
            soapFault.addFaultReasonText("myReason", new Locale("en"));
            soapFault.setFaultCode("mycode");
            soapMessage.saveChanges();

            QName qname = soapFault.getFaultCodeAsQName();
View Full Code Here

            SOAPPart soapPart = soapMessage.getSOAPPart();

            SOAPEnvelope envelope = soapPart.getEnvelope();
            envelope.addNamespaceDeclaration("cwmp", "http://cwmp.com");
            SOAPBody body = envelope.getBody();
            SOAPFault soapFault = body.addFault();
            Detail detail = soapFault.addDetail();
            detail.setAttribute("test", "myvalue");
            soapMessage.saveChanges();
        } catch (Exception e) {
            fail("Unexpected Exception : " + e);
View Full Code Here

            Locale expected3 = Locale.GERMAN;
            boolean found1 = false;
            boolean found2 = false;
            boolean found3 = false;

            SOAPFault sf = body.addFault(SOAPConstants.SOAP_RECEIVER_FAULT, "Its my fault1", expected1);
            sf.addFaultReasonText("Its my fault1", expected1);
            sf.addFaultReasonText("Its my fault2", expected2);
            sf.addFaultReasonText("Its my fault3", expected3);
            Iterator i = sf.getFaultReasonLocales();
View Full Code Here

            //MessageFactory fac = MessageFactory.newInstance();
            SOAPMessage soapMessage = fac.createMessage();
            SOAPPart soapPart = soapMessage.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();
            SOAPFault sf = body.addFault();

            //Setting fault string with no Locale
            sf.setFaultString("this is the fault string");
            Locale result = sf.getFaultStringLocale();
            assertNotNull(result);
View Full Code Here

            //MessageFactory fac = MessageFactory.newInstance();
            SOAPMessage soapMessage = fac.createMessage();
            SOAPPart soapPart = soapMessage.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();
            SOAPFault sf = body.addFault();

            sf.setFaultString("this is the fault string");
            Locale result = sf.getFaultStringLocale();
            assertNotNull(result);
            assertTrue(result.equals(Locale.getDefault()));
View Full Code Here

            //MessageFactory fac = MessageFactory.newInstance();
            SOAPMessage soapMessage = fac.createMessage();
            SOAPPart soapPart = soapMessage.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();
            SOAPFault sf = body.addFault();

            Locale expected = Locale.ENGLISH;
            sf.setFaultString("this is the fault string", expected);
            Locale result = sf.getFaultStringLocale();
            assertNotNull(result);
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.