Package javax.xml.ws.handler

Examples of javax.xml.ws.handler.MessageContext


        }
    }

    private boolean handleMessageInternal(SoapMessage message) {
       
        MessageContext context = createProtocolMessageContext(message);
        if (context == null) {
            return true;
        }
               
        HandlerChainInvoker invoker = getInvoker(message);
View Full Code Here


      return items.toString();
   }

   private void initSessionState()
   {
      MessageContext msgContext = context.getMessageContext();
      clientid = (String)msgContext.get("clientid");
      if (clientid == null)
         throw new IllegalStateException("Cannot obtain clientid");

      // Get the client's items
      items = clientStateMap.get(clientid);
View Full Code Here

      return items.toString();
   }

   private void initSessionState()
   {
      MessageContext msgContext = context.getMessageContext();
      clientid = (String)msgContext.get("clientid");
      if (clientid == null)
         throw new IllegalStateException("Cannot obtain clientid");

      // Get the client's items
      items = clientStateMap.get(clientid);
View Full Code Here

        this.context = context;
    }
   
    public MessageContext getMessageContext() {
        ThreadContext threadContext = ThreadContext.getThreadContext();
        MessageContext messageContext = threadContext.get(MessageContext.class);
        if (messageContext == null) {
            throw new IllegalStateException("Only calls on the service-endpoint have a MessageContext.");
        }
        return messageContext;
    }
View Full Code Here

        this.context = context;
    }
   
    public MessageContext getMessageContext() {
        ThreadContext threadContext = ThreadContext.getThreadContext();
        MessageContext messageContext = threadContext.get(MessageContext.class);
        if (messageContext == null) {
            throw new IllegalStateException("Only calls on the service-endpoint have a MessageContext.");
        }
        return messageContext;
    }
View Full Code Here

        // web service provider.  The web serivce provider needs supply
        // the MessageContext and an interceptor to do the marshalling as
        // the arguments of the standard container.invoke signature.

        // So let's create a fake message context.
        MessageContext messageContext = new FakeMessageContext();

        // Now let's create a fake interceptor as would be supplied by the
        // web service provider.  Instead of writing "fake" marshalling
        // code that would pull the arguments from the soap message, we'll
        // just give it the argument values directly.
View Full Code Here

   * @return Admin object based on the SSL client certificate
   */
  protected Admin getAdmin(boolean allowNonAdmins) throws AuthorizationDeniedException, EjbcaException {
    Admin admin = null;
    try {
      MessageContext msgContext = wsContext.getMessageContext();
      HttpServletRequest request = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
      X509Certificate[] certificates = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");

      if ((certificates == null) || (certificates[0] == null)) {
        throw new AuthorizationDeniedException("Error no client certificate recieved used for authentication.");
      }
View Full Code Here

   * @return
   * @throws AuthorizationDeniedException
   */
  protected boolean isAdmin() throws EjbcaException {
    boolean retval = false;
    MessageContext msgContext = wsContext.getMessageContext();
    HttpServletRequest request = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
    X509Certificate[] certificates = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");

    if(certificates == null){
      throw new EjbcaException(ErrorCode.AUTH_CERT_NOT_RECEIVED,
                "Error no client certificate recieved used for authentication.");
View Full Code Here

   * The main method performing the actual calls
   */
  public Source invoke(Source request) {
    Source response = null;
   
    MessageContext msgContext = wsContext.getMessageContext();   
    HttpServletRequest httpreq = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
    String remoteIP = httpreq.getRemoteAddr();
   
    Document requestDoc = null;
    try{
      DOMResult dom = new DOMResult();
View Full Code Here

                throw new NoInMessageAvailableException(me);
            }
            NormalizedMessage out = me.createMessage();
            Tie tie = new Tie();
            WSConnection con = new WSConnectionDelegate(in, out);
            MessageContext msgCtxt = new MessageContextImpl();
            WebServiceContext wsContext = rtEndpointInfo.getWebServiceContext();
            wsContext.setMessageContext(msgCtxt);
            tie.handle(con, rtEndpointInfo);
            if (isInAndOut(me)) {
                me.setMessage(out, "out");
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.MessageContext

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.