Package javax.xml.rpc.soap

Examples of javax.xml.rpc.soap.SOAPFaultException


     */
    public void testMakeFaultOutOfSOAPFaultException() {

        QName faultcode = new QName(soapConsts.getEnvelopeURI(), "Server.MySubClass");

        SOAPFaultException soapFaultException = new SOAPFaultException(faultcode, "MyFaultString", "http://myactor", null);

        AxisFault axisFault = AxisFault.makeFault(soapFaultException);

        assertEquals(faultcode, axisFault.getFaultCode());
    }
View Full Code Here


    /**
     * Tests if SOAP fault details are passed to AxisFault objects
     */
    public void testDetails() {
        SOAPFaultException soapFaultException = new SOAPFaultException(QNAME_FAULT_SERVER_USER, "MyFaultString", "http://myactor", getTestDetail());

        AxisFault axisFault = AxisFault.makeFault(soapFaultException);

        assertNotNull(axisFault.getFaultDetails());

View Full Code Here

     * can throw an SOAPFaultException and all the information as faultcode and faultactor
     * is passed to the caller
     * @throws Exception
     */
    public void doSth() throws Exception {
        throw new SOAPFaultException(QNAME_FAULT_SERVER_USER, "MyFaultString", "http://myactor", getTestDetail());
    }
View Full Code Here

    public void testRequestHandlerThrowsSFE() throws Exception {
        SOAPService soapService = new SOAPService();

        // SETUP THE 2nd HANDLER IN THE REQUEST CHAIN TO THROW SOAPFaultException
        handler1Config.put("HANDLE_REQUEST_RETURN_VALUE",
                new SOAPFaultException(null, "f", "f", new Detail()));
        TestHandlerInfoChainFactory factory = buildInfoChainFactory();
        soapService.setOption(Constants.ATTR_HANDLERINFOCHAIN, factory);
        soapService.init();
        MessageContext msgContext = new TestMessageContext();
        soapService.invoke(msgContext);
View Full Code Here

    public void testHandleFaultReturnsFalse() throws Exception {
        SOAPService soapService = new SOAPService();

        // SETUP THE LAST HANDLER IN THE REQUEST CHAIN TO THROW SOAPFaultException
        handler2Config.put("HANDLE_REQUEST_RETURN_VALUE",
                new SOAPFaultException(null, "f", "f", new Detail()));
        handler1Config.put("HANDLE_FAULT_RETURN_VALUE", Boolean.FALSE);
        TestHandlerInfoChainFactory factory = buildInfoChainFactory();
        soapService.setOption(Constants.ATTR_HANDLERINFOCHAIN, factory);
        soapService.init();
        MessageContext msgContext = new TestMessageContext();
View Full Code Here

    public void testFaultHandlerThrowsJAXRPCException() throws Exception {
        SOAPService soapService = new SOAPService();

        // SETUP THE LAST HANDLER IN THE REQUEST CHAIN TO THROW SOAPFaultException
        handler2Config.put("HANDLE_REQUEST_RETURN_VALUE",
                new SOAPFaultException(null, "f", "f", new Detail()));
        handler1Config.put("HANDLE_FAULT_RETURN_VALUE", new JAXRPCException());
        TestHandlerInfoChainFactory factory = buildInfoChainFactory();
        soapService.setOption(Constants.ATTR_HANDLERINFOCHAIN, factory);
        soapService.init();
        MessageContext msgContext = new TestMessageContext();
View Full Code Here

    public void testFaultHandlerThrowsRuntimeException() throws Exception {
        SOAPService soapService = new SOAPService();

        // SETUP THE LAST HANDLER IN THE REQUEST CHAIN TO THROW SOAPFaultException
        handler2Config.put("HANDLE_REQUEST_RETURN_VALUE",
                new SOAPFaultException(null, "f", "f", new Detail()));
        handler1Config.put("HANDLE_FAULT_RETURN_VALUE", new RuntimeException());
        TestHandlerInfoChainFactory factory = buildInfoChainFactory();
        soapService.setOption(Constants.ATTR_HANDLERINFOCHAIN, factory);
        soapService.init();
        MessageContext msgContext = new TestMessageContext();
View Full Code Here

         return res;

      }
      catch (SubscriptionError e)
      {
         throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(), null, null);
      }
   }
View Full Code Here

    * Namely NotifyTo and EndTo need to be set.
    * @param request
    */
   private void assertSubscriberEndpoints(Subscribe request) {
      if(null == request.getDelivery().getNotifyTo() ||  null == request.getEndTo() )
         throw new SOAPFaultException( buildFaultQName(EventingConstants.CODE_INVALID_MESSAGE) ,
            "Subcriber endpoint information missing from request",
            null, null
         );
   }
View Full Code Here

         return response;
      }
      catch (SubscriptionError e)
      {
         throw new SOAPFaultException(buildFaultQName(e.getSubcode()), e.getReason(), null, null);
      }
   }
View Full Code Here

TOP

Related Classes of javax.xml.rpc.soap.SOAPFaultException

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.