Package javax.xml.ws

Examples of javax.xml.ws.ProtocolException


            if (logicalhandler1_MessageResultDesired == ResultDesired.TRUE)
                return true;
            else if (logicalhandler1_MessageResultDesired == ResultDesired.FALSE)
                return false;
            else if (logicalhandler1_MessageResultDesired == ResultDesired.PROTOCOL_EXCEPTION)
                throw new ProtocolException();
            else if (logicalhandler1_MessageResultDesired == ResultDesired.OTHER_EXCEPTION)
                throw new RuntimeException();

            // default
            return true;
View Full Code Here


            if (logicalhandler2_FaultResultDesired == ResultDesired.TRUE)
                return true;
            else if (logicalhandler2_FaultResultDesired == ResultDesired.FALSE)
                return false;
            else if (logicalhandler2_FaultResultDesired == ResultDesired.PROTOCOL_EXCEPTION)
                throw new ProtocolException();
            else if (logicalhandler2_FaultResultDesired == ResultDesired.OTHER_EXCEPTION)
                throw new RuntimeException();

            // default
            return true;
View Full Code Here

            if (logicalhandler2_MessageResultDesired == ResultDesired.TRUE)
                return true;
            else if (logicalhandler2_MessageResultDesired == ResultDesired.FALSE)
                return false;
            else if (logicalhandler2_MessageResultDesired == ResultDesired.PROTOCOL_EXCEPTION)
                throw new ProtocolException();
            else if (logicalhandler2_MessageResultDesired == ResultDesired.OTHER_EXCEPTION)
                throw new RuntimeException();

            // default
            return true;
View Full Code Here

     * @return ProtocolException
     */
    public static ProtocolException makeProtocolException(String message, Throwable throwable) {
        try {
            // See if there is already a ProtocolException
            ProtocolException e =
                    (ProtocolException)findException(throwable, ProtocolException.class);
            if (e == null) {
                e = createProtocolException(message, throwable);
            }
            return e;
View Full Code Here

        Throwable rootCause = null;
        if (t != null) {
            rootCause = getRootCause(t);
        }
        rootCause = rootCause == null ? t : rootCause;
        ProtocolException e = null;
        if (message != null) {
            e = new ProtocolException(message, rootCause);
        } else {
            e = new ProtocolException(rootCause);
        }
        if (log.isDebugEnabled()) {
            log.debug("create Exception:", e);
        }
        return e;
View Full Code Here

    public static WebServiceException getFaultResponse(MessageContext msgCtx) {
        Message msg = msgCtx.getMessage();
        if (msg != null && msg.isFault()) {
            //XMLFault fault = msg.getXMLFault();
            // 4.3.2 conformance bullet 1 requires a ProtocolException here
            ProtocolException pe =
                    MethodMarshallerUtils.createSystemException(msg.getXMLFault(), msg);
            return pe;
        } else if (msgCtx.getLocalException() != null) {
            // use the factory, it'll throw the right thing:
            return ExceptionFactory.makeWebServiceException(msgCtx.getLocalException());
View Full Code Here

   
    /**
     * @teststrategy Tests creation of a WebServiceException->WebServiceException->ProtocolException
     */
    public void testExceptionFactory02() throws Exception {
      ProtocolException pe = new ProtocolException(sampleText);
      try{
        WebServiceException wse = (WebServiceException) ExceptionFactory.makeWebServiceException(pe);
        throw ExceptionFactory.makeWebServiceException(wse);
      } catch(WebServiceException e){
        // Should only be a single WebServiceException with a Protocol Exception
View Full Code Here

        Boolean outbound = (Boolean)messagecontext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
        if (!outbound) {  // inbound request if we're on the server
            LogicalMessage msg = messagecontext.getMessage();
            String st = getStringFromSourcePayload(msg.getPayload());
            if (st.contains("<arg0>99</arg0>")) {
                throw new ProtocolException("I don't like the value 99");
            }
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - 1);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
           
View Full Code Here

     *
     * @param message
     * @return
     */
    public static ProtocolException createSystemException(XMLFault xmlFault, Message message) {
        ProtocolException e = null;
        Protocol protocol = message.getProtocol();
        String text = xmlFault.getReason().getText();

        if (protocol == Protocol.soap11 || protocol == Protocol.soap12) {
            // Throw a SOAPFaultException
View Full Code Here

            Source s = msg.getPayload();
            s = msg.getPayload();
           
            String st = getStringFromSourcePayload(msg.getPayload());
            if (st.contains("<arg0>99</arg0>")) {
                throw new ProtocolException("I don't like the value 99");
            }
           
            // Check for the presences of the attachment property
            String propKey = MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS;
            Map map = (Map) messagecontext.get(propKey);
View Full Code Here

TOP

Related Classes of javax.xml.ws.ProtocolException

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.