Package javax.xml.ws.handler.soap

Examples of javax.xml.ws.handler.soap.SOAPMessageContext


         HttpServletRequest request = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);
        
         String conversationId = Manager.instance().getCurrentConversationId();
         if (conversationId != null)
         {
            SOAPMessageContext smc = (SOAPMessageContext) messageContext;
           
            SOAPHeader header = smc.getMessage().getSOAPHeader();
            if (header != null)
            {
               SOAPElement element = header.addChildElement(CIDQN);
               element.addTextNode(conversationId);
               smc.getMessage().saveChanges();              
            }           
         }
        
         Manager.instance().endRequest( new ServletRequestSessionMap(request) );
        
View Full Code Here


    * @throws SOAPException
    */
   private String extractConversationId(MessageContext messageContext)
      throws SOAPException
   {
      SOAPMessageContext smc = (SOAPMessageContext) messageContext;
      SOAPHeader header = smc.getMessage().getSOAPHeader();
     
      if (header != null)
      {
         Iterator iter = header.getChildElements(CIDQN);
         if (iter.hasNext())
View Full Code Here

    @Override
    protected void initialize(MessageContext mc) {
        super.initialize(mc);   
       
        SOAPMessageContext soapMC = (SOAPMessageContext)POJOWebServiceContext.get().getMessageContext();
        ContextUtils.addWSDLProperties_provider(mc, soapMC);
    }
View Full Code Here

    @Override
    protected void initialize(MessageContext mc) {
        super.initialize(mc);   
       
        SOAPMessageContext soapMC = (SOAPMessageContext)POJOWebServiceContext.get().getMessageContext();
        ContextUtils.addWSDLProperties(mc, soapMC);
    }
View Full Code Here

      return cookie.toString();
   }

   public boolean handleResponse(MessageContext msgContext)
   {
      SOAPMessageContext smc = (SOAPMessageContext)msgContext;
      SOAPMessage message = smc.getMessage();
      MimeHeaders mimeHeaders = message.getMimeHeaders();
      String[] cookieValues = mimeHeaders.getHeader(CookieUtil.SET_COOKIE);

      String endpointAddress = (String)msgContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
      if (cookieValues != null)
View Full Code Here

      return true;
   }

   public boolean handleResponse(MessageContext msgContext)
   {
      SOAPMessageContext smc = (SOAPMessageContext)msgContext;
      SOAPMessage message = smc.getMessage();
      MimeHeaders mimeHeaders = message.getMimeHeaders();
      String[] cookieValues = mimeHeaders.getHeader("Set-Cookie");

      if (cookieValues != null)
      {
View Full Code Here

    @Test
    public void handleMessage() throws Exception
    {
        final SOAPSamlHandler handler = new SOAPSamlHandler();
        final SOAPMessageContext messageContext = mock(SOAPMessageContext.class);
        final SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();

        when(messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)).thenReturn(true);
        when(messageContext.getMessage()).thenReturn(soapMessage);

        SamlCredential samlPrincipal = new SamlCredential(StreamUtils.readStreamString(getClass().getResourceAsStream("assertion.xml"), "UTF-8"));

        boolean result = handler.handleMessage(messageContext);
        assertTrue(result);
View Full Code Here

   private boolean verifyXOPPackage(MessageContext context)
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context;
         SOAPMessage soapMsg = msgContext.getMessage();
         SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
         SOAPBody body = soapEnv.getBody();
         boolean found = scanNodes(body.getChildNodes());

         if(found) throw new IllegalStateException("XOP request not properly inlined");
View Full Code Here

   private boolean verifyXOPPackage(MessageContext context)
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context;
         SOAPMessage soapMsg = msgContext.getMessage();
         SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
         SOAPBody body = soapEnv.getBody();
         boolean found = scanNodes(body.getChildNodes());

         if(found) throw new IllegalStateException("XOP request not properly inlined");
View Full Code Here

    public static void addWSDLProperties(MessageContext jaxwsMessageContext) {
        org.apache.axis2.context.MessageContext msgContext =
                jaxwsMessageContext.getAxisMessageContext();
        ServiceContext serviceContext = msgContext.getServiceContext();
        SOAPMessageContext soapMessageContext = null;
        if (serviceContext != null) {
            WebServiceContext wsc =
                    (WebServiceContext)serviceContext.getProperty(WEBSERVICE_MESSAGE_CONTEXT);
            if (wsc != null) {
                soapMessageContext = (SOAPMessageContext)wsc.getMessageContext();
            }
        }
        OperationDescription op = jaxwsMessageContext.getOperationDescription();

        if (op != null && soapMessageContext != null) {
            soapMessageContext
                    .put(javax.xml.ws.handler.MessageContext.WSDL_OPERATION, op.getName());
            soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_OPERATION,
                                        Scope.APPLICATION);
            if (log.isDebugEnabled()) {
                log.debug("WSDL_OPERATION :" + op.getName());
            }

            EndpointInterfaceDescription eid = op.getEndpointInterfaceDescription();
            if (eid != null) {
                EndpointDescription ed = eid.getEndpointDescription();
                QName portType = eid.getPortType();
                if (portType == null || portType.getLocalPart() == "") {
                    if (log.isDebugEnabled()) {
                        log.debug(
                                "Did not get port type from EndpointInterfaceDescription, attempting to get PortType from EndpointDescription");
                    }
                }
                if (ed != null) {
                    soapMessageContext
                            .put(javax.xml.ws.handler.MessageContext.WSDL_PORT, ed.getPortQName());
                    soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_PORT,
                                                Scope.APPLICATION);
                    if (log.isDebugEnabled()) {
                        log.debug("WSDL_PORT :" + ed.getPortQName());
                    }
                }
                soapMessageContext
                        .put(javax.xml.ws.handler.MessageContext.WSDL_INTERFACE, portType);
                soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_INTERFACE,
                                            Scope.APPLICATION);
                if (log.isDebugEnabled()) {
                    log.debug("WSDL_INTERFACE :" + portType);
                }
            }
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.soap.SOAPMessageContext

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.