Package org.apache.cxf.ws.policy

Examples of org.apache.cxf.ws.policy.PolicyException


        attachments = new ArrayList<PolicyAttachment>();
        Document doc = null;
        try {
            InputStream is = location.getInputStream();
            if (null == is) {
                throw new PolicyException(new Message("COULD_NOT_OPEN_ATTACHMENT_DOC_EXC", BUNDLE, location));
            }
            doc = DOMUtils.readXml(is);
        } catch (Exception ex) {
            throw new PolicyException(ex);
        }
       
        for (Element ae
                : PolicyConstants
                    .findAllPolicyElementsOfLocalName(doc,
View Full Code Here


                if (ai.getAssertion() == assertion) {
                    ai.setNotAsserted(reason.getMessage());
                }
            }
        }
        throw new PolicyException(reason);
    }
View Full Code Here

                    ai.setNotAsserted(reason);
                }
            }
        }
        if (!assertion.isOptional()) {
            throw new PolicyException(new Message(reason, LOG));
        }
    }
View Full Code Here

                if (ai.getAssertion() == assertion) {
                    ai.setNotAsserted(reason.getMessage());
                }
            }
        }
        throw new PolicyException(reason);
    }
View Full Code Here

                    ai.setNotAsserted(reason);
                }
            }
        }
        if (!assertion.isOptional()) {
            throw new PolicyException(new Message(reason, LOG));
        }
    }
View Full Code Here

                if (ai.getAssertion() == assertion) {
                    ai.setNotAsserted(reason.getMessage());
                }
            }
        }
        throw new PolicyException(reason);
    }
View Full Code Here

                    ai.setNotAsserted(reason);
                }
            }
        }
        if (!assertion.isOptional()) {
            throw new PolicyException(new Message(reason, LOG));
        }
    }
View Full Code Here

      
        try {
            greeter.sayHi();
            fail("Did not receive expected PolicyException.");
        } catch (WebServiceException wex) {
            PolicyException ex = (PolicyException)wex.getCause();
            assertEquals("INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS", ex.getCode());
        }

        // greetMeOneWay - no message or operation policies

        greeter.greetMeOneWay("CXF");

        // greetMe - operation policy specifies receive timeout and should cause every
        // other invocation to fail

        assertEquals("CXF", greeter.greetMe("cxf"));

        try {
            greeter.greetMe("cxf");
            fail("Didn't get the exception");
        } catch (Exception ex) {
            //ex.printStackTrace();
            assertTrue(ex.getCause().getClass().getName(), ex.getCause() instanceof SocketTimeoutException);
        }
    
        // pingMe - policy attached to binding operation fault should have no effect

        try {
            greeter.pingMe();
            fail("Expected PingMeFault not thrown.");
        } catch (PingMeFault ex) {
            assertEquals(2, (int)ex.getFaultInfo().getMajor());
            assertEquals(1, (int)ex.getFaultInfo().getMinor());
        }

    }
View Full Code Here

        if (null != compatible && null != confPolicy) {
            if (PolicyUtils.compatible(compatible, confPolicy)) {
                compatible = intersect(compatible, confPolicy);
            } else {
                LogUtils.log(LOG, Level.SEVERE, "INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS");
                throw new PolicyException(new org.apache.cxf.common.i18n.Message(
                    "INCOMPATIBLE_HTTPCLIENTPOLICY_ASSERTIONS", LOG));
            }
        }
        return compatible;
    }
View Full Code Here

        if (null != compatible && null != confPolicy) {
            if (PolicyUtils.compatible(compatible, confPolicy)) {
                compatible = intersect(compatible, confPolicy);
            } else {
                LogUtils.log(LOG, Level.SEVERE, "INCOMPATIBLE_HTTPSERVERPOLICY_ASSERTIONS");
                throw new PolicyException(new org.apache.cxf.common.i18n.Message(
                    "INCOMPATIBLE_HTTPSERVERPOLICY_ASSERTIONS", LOG));
            }
        }
        return compatible;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.policy.PolicyException

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.