Package javax.xml.ws.handler

Examples of javax.xml.ws.handler.MessageContext.containsKey()


   
    private boolean validateOutOfBandHander() {
        MessageContext ctx = context == null ? null : context.getMessageContext();
        if (!relayHeaders) {
            if (ctx != null
                && !ctx.containsKey(Header.HEADER_LIST)
                || (ctx.containsKey(Header.HEADER_LIST)
                    && ((List)ctx.get(Header.HEADER_LIST)).size() == 0)) {
                return true;
            }
            return false;
View Full Code Here


    private boolean validateOutOfBandHander() {
        MessageContext ctx = context == null ? null : context.getMessageContext();
        if (!relayHeaders) {
            if (ctx != null
                && !ctx.containsKey(Header.HEADER_LIST)
                || (ctx.containsKey(Header.HEADER_LIST)
                    && ((List)ctx.get(Header.HEADER_LIST)).size() == 0)) {
                return true;
            }
            return false;
        }
View Full Code Here

            }
            return false;
        }
       
        boolean success = false;
        if (ctx != null && ctx.containsKey(Header.HEADER_LIST)) {
            List oobHdr = (List) ctx.get(Header.HEADER_LIST);
            Iterator iter = oobHdr.iterator();
            while (iter.hasNext()) {
                Object hdr = iter.next();
                if (hdr instanceof Header && ((Header) hdr).getObject() instanceof Node) {
View Full Code Here

    }
   
    private boolean checkContext() {
        boolean success = false;
        MessageContext ctx = context == null ? null : context.getMessageContext();
        if (ctx.containsKey(Header.HEADER_LIST)) {
            List oobHdr = (List) ctx.get(Header.HEADER_LIST);
            Iterator iter = oobHdr.iterator();
            while (iter.hasNext()) {
                Object hdr = iter.next();
                if (hdr instanceof Header && ((Header) hdr).getObject() instanceof Node) {
View Full Code Here

        String propKey1 = "AddNumbersLogicalHandlerInboundAppScopedProperty";
        String propKey2 = "AddNumbersLogicalHandlerInboundHandlerScopedProperty";
        String value = (String)mc.get(propKey1);
        if (value == null)
            throw new RuntimeException("Property value for key \"" + propKey1 + "\" was null, but is APPLICATION scoped and should be accessible by the endpoint");
        if (mc.containsKey(propKey2))  // instead of "get", use "containsKey" to be a little more robust in testing
            throw new RuntimeException("MessageContext.containsKey reported true for key \"" + propKey2 + "\" was not null.  This property is HANDLER scoped and should not be accessible by the endpoint");
        TestLogger.logger
                .debug(">> Received addNumbersHandler request for " + arg0 + " and " + arg1);
        if (arg0 == 101)
            throw new RuntimeException("Got value 101.  AddNumbersHandlerPortTypeImpl.addNumbersHandler method is correctly throwing this exception as part of testing");
View Full Code Here

      // Map of attachments to a message for the inbound message, key is  the MIME Content-ID, value is a DataHandler
      msgContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());

      // Remoting meta data are available on successfull call completion
      if (msgContext.containsKey(CommonMessageContext.REMOTING_METADATA))
      {
         Map<?, ?> remotingMetadata = (Map)msgContext.get(CommonMessageContext.REMOTING_METADATA);

         // Get the HTTP_RESPONSE_CODE
         Integer resposeCode = (Integer)remotingMetadata.get(HTTPMetadataConstants.RESPONSE_CODE);
View Full Code Here

        String propKey1 = "AddNumbersLogicalHandlerInboundAppScopedProperty";
        String propKey2 = "AddNumbersLogicalHandlerInboundHandlerScopedProperty";
        String value = (String)mc.get(propKey1);
        if (value == null)
            throw new RuntimeException("Property value for key \"" + propKey1 + "\" was null, but is APPLICATION scoped and should be accessible by the endpoint");
        if (mc.containsKey(propKey2))  // instead of "get", use "containsKey" to be a little more robust in testing
            throw new RuntimeException("MessageContext.containsKey reported true for key \"" + propKey2 + "\" was not null.  This property is HANDLER scoped and should not be accessible by the endpoint");
        TestLogger.logger
                .debug(">> Received addNumbersHandler request for " + arg0 + " and " + arg1);
        if (arg0 == 101)
            throw new RuntimeException("Got value 101.  AddNumbersHandlerPortTypeImpl.addNumbersHandler method is correctly throwing this exception as part of testing");
View Full Code Here

    }
   
    private boolean checkContext() {
        boolean success = false;
        MessageContext ctx = context == null ? null : context.getMessageContext();
        if (ctx.containsKey(Header.HEADER_LIST)) {
            List oobHdr = (List) ctx.get(Header.HEADER_LIST);
           
            if (oobHdr instanceof List) {
                Iterator iter = oobHdr.iterator();
                while (iter.hasNext()) {
View Full Code Here

        xchng.setOutMessage(outMsg);
       
        responseContext.put(MessageContext.HTTP_RESPONSE_CODE, RESPONSE_CODE);
       
        MessageContext ctx = EasyMock.createMock(MessageContext.class);
        ctx.containsKey(MessageContext.HTTP_RESPONSE_CODE);
        EasyMock.expectLastCall().andReturn(true);
        ctx.get(MessageContext.HTTP_RESPONSE_CODE);
        EasyMock.expectLastCall().andReturn(RESPONSE_CODE);
       
        ctx.containsKey(Header.HEADER_LIST);
View Full Code Here

        ctx.containsKey(MessageContext.HTTP_RESPONSE_CODE);
        EasyMock.expectLastCall().andReturn(true);
        ctx.get(MessageContext.HTTP_RESPONSE_CODE);
        EasyMock.expectLastCall().andReturn(RESPONSE_CODE);
       
        ctx.containsKey(Header.HEADER_LIST);
        EasyMock.expectLastCall().andReturn(true);
        ctx.get(Header.HEADER_LIST);
        EasyMock.expectLastCall().andReturn(hdrList);
        ctx.get(Header.HEADER_LIST);
        EasyMock.expectLastCall().andReturn(hdrList);
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.