Package javax.xml.ws.handler.soap

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


   public String namespace()
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();
         SOAPMessage soapMessage = msgContext.getMessage();
         SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapMessage.getSOAPPart().getEnvelope();
         String nsURI = soapEnvelope.getNamespaceURI();

         log.info(nsURI);
View Full Code Here


   {
      log.info("handleInbound()");

      try
      {
         SOAPMessageContext smc = (SOAPMessageContext)msgContext;
         SOAPMessage message = smc.getMessage();

         SOAPBody body = message.getSOAPBody();
         Document document = body.extractContentAsDocument();
         Node node = document;
View Full Code Here

   public String namespace()
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();
         SOAPMessage soapMessage = msgContext.getMessage();
         SOAPEnvelope soapEnvelope = (SOAPEnvelope)soapMessage.getSOAPPart().getEnvelope();
         String nsURI = soapEnvelope.getNamespaceURI();

         log.info(nsURI);
View Full Code Here

   @Override
   protected boolean handleInbound(final MessageContext msgContext)
   {
      try
      {
         SOAPMessageContext smc = (SOAPMessageContext) msgContext;
         SOAPMessage message = smc.getMessage();

         SOAPBody body = message.getSOAPBody();
         Document document = body.extractContentAsDocument();
         NodeList nodes = document.getChildNodes();
         for (int i = 0; i < nodes.getLength(); i++)
View Full Code Here

   public boolean handleMessage(MessageContext context)
   {
      log.debug("handleMessage...");
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context;
         SOAPBody body = msgContext.getMessage().getSOAPBody();
         String bodyStr = DOMWriter.printNode(body, false);
         if (bodyStr.indexOf("http://example.org/sei") < 0)
            throw new WebServiceException("Invalid body: " + bodyStr);
      }
      catch (SOAPException ex)
View Full Code Here

   {
      log.info("handleInbound()");

      try
      {
         SOAPMessageContext smc = (SOAPMessageContext)msgContext;
         SOAPMessage message = smc.getMessage();

         SOAPBody body = message.getSOAPBody();
         Document document = body.extractContentAsDocument();
         Node node = document;
View Full Code Here

        
         try
         {
            MessageFactory factory = MessageFactory.newInstance();
            SOAPMessage resMessage = factory.createMessage(null, new ByteArrayInputStream(resEnv.getBytes()));
            SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
            soapContext.setMessage(resMessage);
         }
         catch (Exception e)
         {
            throw new RuntimeException("Cannot attach response message");
         }
View Full Code Here

   @WebMethod
   public String echo(String input)
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();

         // log message
         SOAPMessage soapMessage = msgContext.getMessage();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         soapMessage.writeTo(baos);
         log.info(new String(baos.toByteArray()));
        
         SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
         ReferenceParameters refParams = addrProps.getReferenceParameters();
         for (Object refParam : refParams.getElements())
         {
            input += "|" + ((SOAPElement)refParam).getValue();
         }
View Full Code Here

      @Override
      public boolean handleFault(MessageContext msgContext)
      {
         try
         {
            SOAPMessageContext smc = (SOAPMessageContext) msgContext;
            SOAPMessage message = smc.getMessage();
            Iterator iterator = message.getSOAPHeader().getChildElements(
                  new QName("http://www.w3.org/2005/08/addressing", "Action"));
            if (iterator.hasNext())
            {
               SOAPElement element = (SOAPElement) iterator.next();
View Full Code Here

   @Override
   protected boolean handleInbound(final MessageContext msgContext)
   {
      try
      {
         SOAPMessageContext smc = (SOAPMessageContext) msgContext;
         SOAPMessage message = smc.getMessage();

         SOAPBody body = message.getSOAPBody();
         Document document = body.extractContentAsDocument();
         NodeList nodes = document.getChildNodes();
         for (int i = 0; i < nodes.getLength(); i++)
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.