Examples of createFault()


Examples of javax.xml.soap.SOAPFactory.createFault()

   {
      // This should be thrown as-is
      try
      {
         SOAPFactory factory = SOAPFactory.newInstance();
         SOAPFault fault = factory.createFault("this is a fault string!", new QName("http://foo", "FooCode"));
         fault.setFaultActor("mr.actor");
         fault.addDetail().addChildElement("test");
         throw new SOAPFaultException(fault);
      }
      catch (SOAPException s)
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    public GreetMeResponse greetMe(GreetMeRequest gmr) {
        if ("fault".equals(gmr.getName())) {
            try {
                SOAPFactory factory = SOAPFactory.newInstance();
                SOAPFault fault = factory.createFault("this is a fault string!",
                                                      new QName("http://foo", "FooCode"));
                fault.setFaultActor("mr.actor");
                fault.addDetail().addChildElement("test").addTextNode("TestText");
                throw new SOAPFaultException(fault);
            } catch (SOAPException ex) {
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    }

    public void testSetGetFaultCodeAsName1() {
        try {
            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
            SOAPFault sf = fac.createFault();

            Name name = fac.createName("myfault", "flt", "http://example.com");
            sf.setFaultCode(name);
           
            Name name2 = sf.getFaultCodeAsName();           
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

        try {
            QName qname = SOAPConstants.SOAP_SENDER_FAULT;
            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            Name name = fac.createName(qname.getLocalPart(),
                                       qname.getPrefix(), qname.getNamespaceURI());
            SOAPFault sf = fac.createFault();
            sf.setFaultCode(name);
           
            Name name2 = sf.getFaultCodeAsName();           
            assertNotNull(name2);
            assertEquals(name.getLocalName(), name2.getLocalName());
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    }


    public void testSetGetFaultCodeAsQName1() throws Exception {
        SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
        SOAPFault sf = fac.createFault();

        QName name = new QName("http://example.com", "myfault", "flt");
        sf.setFaultCode(name);
       
        QName name2 = sf.getFaultCodeAsQName();
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    public void testSetGetFaultCodeAsQName2() {
        try {
            QName name = SOAPConstants.SOAP_SENDER_FAULT;
            SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            SOAPFault sf = fac.createFault();
            sf.setFaultCode(name);
           
            QName name2 = sf.getFaultCodeAsQName();
            assertNotNull(name2);
            assertEquals(name.getLocalPart(), name2.getLocalPart());
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

        try {
            SOAPFactory factory = SOAPFactory.newInstance();
            if (factory == null) {
                fail("createFaultTest1() could not create SOAPFactory object");
            }
            SOAPFault sf = factory.createFault();
            if (sf == null) {
                fail("createFault() returned null");
            } else if (!(sf instanceof SOAPFault)) {
                fail("createFault() did not create a SOAPFault object");
            }
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    public void testCreateFault() {
        try {
            SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            //SOAPFactory factory = SOAPFactory.newInstance();
            SOAPFault sf = factory.createFault("This is the fault reason.",
                                               SOAPConstants.SOAP_RECEIVER_FAULT);
            assertNotNull(sf);
            assertTrue(sf instanceof SOAPFault);
            QName fc = sf.getFaultCodeAsQName();
            //Expect FaultCode="+SOAPConstants.SOAP_RECEIVER_FAULT
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    public void testCreateFault1() {
        try {
            //SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            SOAPFactory factory = SOAPFactory.newInstance();
            SOAPFault sf = factory.createFault("This is the fault reason.",
                                               SOAPConstants.SOAP_RECEIVER_FAULT);
            assertNotNull(sf);
            QName fc = sf.getFaultCodeAsQName();
            Iterator i = sf.getFaultReasonTexts();
View Full Code Here

Examples of javax.xml.soap.SOAPFactory.createFault()

    /** for soap 1.1 */
    public void testSOAPFaultException1() {
        try {
            SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            SOAPFault fault = factory.createFault("This is the fault reason.",
                                                  new QName("http://MyNamespaceURI.org/",
                                                            "My Fault Code"));
        } catch (UnsupportedOperationException e) {
            //Caught expected UnsupportedOperationException
        } catch (SOAPException e) {
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.