Package org.jboss.ws.core.soap

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


      else
      {
         Style style = paramMetaData.getOperationMetaData().getStyle();
         if (style == Style.DOCUMENT)
         {
            contentElement = new SOAPBodyElementDoc(soapName);
            soapElement.addChildElement(contentElement);
         }
         else
         {
            contentElement = new SOAPContentElement(soapName);
View Full Code Here


/*  90 */         Source source = (Source)obj;
/*  91 */         if (this.mode == Service.Mode.PAYLOAD)
/*     */         {
/*  93 */           reqMsg = (SOAPMessageImpl)factory.createMessage();
/*  94 */           SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
/*  95 */           SOAPContentElement bodyElement = new SOAPBodyElementDoc(SOAPBodyElementDoc.GENERIC_PARAM_NAME);
/*  96 */           bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);
/*  97 */           XMLFragment xmlFragment = new XMLFragment(source);
/*  98 */           bodyElement.setXMLFragment(xmlFragment);
/*     */
/* 101 */           if (this.validateDispatch)
/*     */           {
/* 104 */             xmlFragment.toElement();
/*     */           }
/*     */         }
/*     */
/* 108 */         if (this.mode == Service.Mode.MESSAGE)
/*     */         {
/* 110 */           TransformerFactory tf = TransformerFactory.newInstance();
/* 111 */           ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
/* 112 */           tf.newTransformer().transform(source, new StreamResult(baos));
/* 113 */           reqMsg = (SOAPMessageImpl)factory.createMessage(null, new ByteArrayInputStream(baos.toByteArray()));
/*     */         }
/*     */       }
/* 116 */       else if (this.jaxbContext != null)
/*     */       {
/* 118 */         Marshaller marshaller = this.jaxbContext.createMarshaller();
/* 119 */         marshaller.setProperty("jaxb.fragment", Boolean.valueOf(true));
/* 120 */         ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
/* 121 */         marshaller.marshal(obj, baos);
/*     */
/* 123 */         reqMsg = (SOAPMessageImpl)factory.createMessage();
/* 124 */         SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody();
/* 125 */         SOAPContentElement bodyElement = new SOAPBodyElementDoc(SOAPBodyElementDoc.GENERIC_PARAM_NAME);
/* 126 */         bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);
/* 127 */         StreamSource source = new StreamSource(new ByteArrayInputStream(baos.toByteArray()));
/* 128 */         bodyElement.setXMLFragment(new XMLFragment(source));
/*     */       }
/*     */     }
/*     */     catch (RuntimeException rte)
/*     */     {
/* 133 */       throw rte;
View Full Code Here

/*     */     else
/*     */     {
/* 764 */       Style style = paramMetaData.getOperationMetaData().getStyle();
/* 765 */       if (style == Style.DOCUMENT)
/*     */       {
/* 767 */         SOAPContentElement contentElement = new SOAPBodyElementDoc(soapName);
/* 768 */         soapElement.addChildElement(contentElement);
/*     */       }
/*     */       else
/*     */       {
/* 772 */         contentElement = new SOAPContentElement(soapName);
/* 773 */         soapElement.addChildElement(contentElement);
/*     */       }
/*     */     }
/*     */
/* 777 */     contentElement.setParamMetaData(paramMetaData);
/*     */
/* 779 */     if (paramMetaData.isSOAPArrayParam())
/*     */     {
/* 781 */       this.log.trace("Add parameter as SOAP encoded Array");
/* 782 */       contentElement.addNamespaceDeclaration("soap11-enc", "http://schemas.xmlsoap.org/soap/encoding/");
/*     */     }
/*     */
/* 787 */     if ((paramMetaData.isXOP()) && (XOPContext.isMTOMEnabled()))
/*     */     {
/* 789 */       this.log.trace("Add parameter as XOP");
/* 790 */       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
/* 791 */       SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
/* 792 */       soapMessage.setXOPMessage(true);
/*     */     }
/* 794 */     else if (paramMetaData.isSwaRef())
/*     */     {
/* 796 */       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
/* 797 */       SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
/* 798 */       soapMessage.setSWARefMessage(true);
/*     */     }
/*     */
/* 801 */     contentElement.setObjectValue(value);
/*     */
/* 803 */     return contentElement;
/*     */   }
View Full Code Here

/* 130 */       msgContext.setSOAPMessage(resMessage);
/*     */
/* 132 */       ParameterMetaData retParameter = opMetaData.getReturnParameter();
/* 133 */       QName xmlName = retParameter.getXmlName();
/* 134 */       SOAPBodyImpl soapBody = (SOAPBodyImpl)resMessage.getSOAPBody();
/* 135 */       SOAPContentElement bodyElement = new SOAPBodyElementDoc(xmlName);
/* 136 */       bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);
/*     */
/* 138 */       Source payload = (Source)epInv.getReturnValue();
/* 139 */       bodyElement.setXMLFragment(new XMLFragment(payload));
/*     */
/* 141 */       return resMessage;
/*     */     }
/*     */     catch (Exception e)
/*     */     {
View Full Code Here

TOP

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

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.