Package org.jboss.ws.core.soap

Examples of org.jboss.ws.core.soap.SOAPContentElement


         // the content element as is.
         // Note, that it is possible for a Java type to be bound to an any
         // type, so checking the xml type is not sufficient.
         if (!Element.class.isAssignableFrom(javaType))
         {
            SOAPContentElement soapElement = (SOAPContentElement)paramValue;
            retValue = soapElement.getObjectValue();
         }
      }

      if (log.isDebugEnabled())
         log.debug("transformPayloadValue: " + getTypeName(paramValue) + " -> " + getTypeName(retValue));
View Full Code Here


         {
            source = new DOMSource(bodyElement);
         }
         else
         {
            SOAPContentElement contentElement = (SOAPContentElement)bodyElement;
            source = contentElement.getXMLFragment().getSource();
         }
      }
      else if (message instanceof HTTPMessageImpl)
      {
         HTTPMessageImpl httpMessage = (HTTPMessageImpl)message;
View Full Code Here

                  WSException.rethrow(ex);
               }
            }
            else
            {
               SOAPContentElement contentElement = (SOAPContentElement)bodyElement;
               contentElement.setXMLFragment(new XMLFragment(source));
            }
         }
         catch (SOAPException ex)
         {
            throw new WebServiceException("Cannot set xml payload", ex);
View Full Code Here

      if (message instanceof SOAPMessage)
      {
         SOAPMessage soapMessage = (SOAPMessage)message;
         SOAPBodyImpl soapBody = getSOAPBody(soapMessage);

         SOAPContentElement bodyElement = (SOAPContentElement)getBodyElement(soapBody);
         if (bodyElement != null)
         {
            payload = bodyElement.getObjectValue();
         }
      }
      else if (message instanceof HTTPMessageImpl)
      {
         throw new NotImplementedException();
View Full Code Here

      if (message instanceof SOAPMessage)
      {
         SOAPMessage soapMessage = (SOAPMessage)message;
         SOAPBodyImpl soapBody = getSOAPBody(soapMessage);

         SOAPContentElement bodyElement = (SOAPContentElement)getBodyElement(soapBody);
         if (bodyElement != null)
         {
            bodyElement.setObjectValue(payload);
            MessageContextAssociation.peekMessageContext().setModified(true);
         }
      }
      else if (message instanceof HTTPMessageImpl)
      {
View Full Code Here

      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
        
         // Use propriatary API to test the response value
         SOAPContentElement resElement = (SOAPContentElement)soapElement.getChildElements().next();
         if (resElement.getObjectValue() == null)
         {
            MessageFactory msgFactory = MessageFactory.newInstance();
            SOAPFactory soapFactory = SOAPFactory.newInstance();
           
            soapMessage = msgFactory.createMessage();
View Full Code Here

                  xmlName = namespaceRegistry.registerQName(xmlName);
                  Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());

                  log.debug("Add unboundHeader element: " + soapName);
                  SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
                  contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));

                  if (soapHeader == null)
                     soapHeader = soapEnvelope.addHeader();

                  soapHeader.addChildElement(contentElement);
                  contentElement.setObjectValue(value);
               }
            }
         }

         // Set the SOAPAction
View Full Code Here

                     boolean isHeader = paramMetaData.isInHeader();
                     SOAPElement element = isHeader ? soapHeader : payloadParent;
                     if (!isHeader)
                        numParameters++;

                     SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
                     epInv.setRequestParamValue(xmlName, value);
                  }
               }
            }
View Full Code Here

                  attachments.put(part.getContentId(), dataHandler);
               }
            }
            else
            {
               SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBodyElement);
               epInv.setReturnValue(soapElement);
               soapElement.setObjectValue(value);
            }
         }

         // Add the out parameters to the message
         for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
View Full Code Here

         {
            Map<QName, UnboundHeader> outHeaders = new HashMap<QName, UnboundHeader>();
            Iterator itHeaderElements = soapHeader.getChildElements();
            while (itHeaderElements.hasNext())
            {
               SOAPContentElement soapHeaderElement = (SOAPHeaderElementImpl)itHeaderElements.next();
               Name elName = soapHeaderElement.getElementName();
               QName xmlName = new QName(elName.getURI(), elName.getLocalName());

               UnboundHeader unboundHeader = (UnboundHeader)unboundHeaders.get(xmlName);
               if (unboundHeader != null)
               {
                  soapHeaderElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));

                  // Do the unmarshalling
                  Object value = soapHeaderElement.getObjectValue();
                  unboundHeader.setHeaderValue(value);
                  outHeaders.put(xmlName, unboundHeader);
               }
            }
            unboundHeaders.clear();
            unboundHeaders.putAll(outHeaders);
         }

         Style style = opMetaData.getStyle();
         SOAPElement soapElement = soapBody;
         if (style == Style.RPC)
         {
            if (soapBodyElement == null)
               throw new WSException("Cannot unbind response message with empty soap body");
            soapElement = soapBodyElement;
         }

         ParameterMetaData retMetaData = opMetaData.getReturnParameter();
         if (retMetaData != null)
         {
            if (retMetaData.isSwA())
            {
               AttachmentPart part = getAttachmentFromMessage(retMetaData, resMessage);
               epInv.setReturnValue(part);

               // Add the attachment to the standard property
               if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
               {
                  DataHandler dataHandler = part.getDataHandler();
                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
                  attachments.put(part.getContentId(), dataHandler);
               }
            }
            else
            {
               SOAPContentElement value = getParameterFromMessage(retMetaData, soapElement, false);
               epInv.setReturnValue(value);
            }
         }

         for (ParameterMetaData paramMetaData : opMetaData.getOutputParameters())
         {
            QName xmlName = paramMetaData.getXmlName();
            if (paramMetaData.isSwA())
            {
               AttachmentPart part = getAttachmentFromMessage(paramMetaData, resMessage);
               epInv.setResponseParamValue(xmlName, part);

               // Add the attachment to the standard property
               if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
               {
                  DataHandler dataHandler = part.getDataHandler();
                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
                  attachments.put(part.getContentId(), dataHandler);
               }
            }
            else
            {
               SOAPElement element = paramMetaData.isInHeader() ? soapHeader : soapElement;
               SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
               epInv.setResponseParamValue(xmlName, value);
            }
         }
      }
      catch (Exception e)
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.soap.SOAPContentElement

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.