Package com.sun.xml.txw2.annotation

Examples of com.sun.xml.txw2.annotation.XmlElement


/*     */
/*     */   public void text(StringBuilder text) {
/*     */     try {
/* 102 */       this.out.writeCharacters(text.toString());
/*     */     } catch (XMLStreamException e) {
/* 104 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here


/*     */
/*     */   public void cdata(StringBuilder text) {
/*     */     try {
/* 110 */       this.out.writeCData(text.toString());
/*     */     } catch (XMLStreamException e) {
/* 112 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/*     */   public void comment(StringBuilder comment) {
/*     */     try {
/* 118 */       this.out.writeComment(comment.toString());
/*     */     } catch (XMLStreamException e) {
/* 120 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */   public void endDocument() {
/*     */     try {
/* 126 */       this.out.writeEndDocument();
/* 127 */       this.out.flush();
/*     */     } catch (XMLStreamException e) {
/* 129 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/*     */   public void flush() {
/*     */     try {
/* 135 */       this.out.flush();
/*     */     } catch (XMLStreamException e) {
/* 137 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*  64 */         DocumentBuilder db = dbf.newDocumentBuilder();
/*  65 */         Document doc = db.newDocument();
/*  66 */         domResult.setNode(doc);
/*  67 */         this.serializer = new SaxSerializer(new Dom2SaxAdapter(doc), null, false);
/*     */       } catch (ParserConfigurationException pce) {
/*  69 */         throw new TxwException(pce);
/*     */       }
/*     */     else
/*  72 */       this.serializer = new SaxSerializer(new Dom2SaxAdapter(node), null, false);
/*     */   }
View Full Code Here

/*     */       {
/*  72 */         FileOutputStream fos = new FileOutputStream(fileURL);
/*  73 */         autoClose[0] = fos;
/*  74 */         this.writer = createWriter(fos);
/*     */       } catch (IOException e) {
/*  76 */         throw new TxwException(e);
/*     */       }
/*     */     } else {
/*  79 */       throw new IllegalArgumentException();
/*     */     }
/*     */
/*  82 */     this.serializer = new SaxSerializer(this.writer, this.writer, false, autoClose) {
/*     */       public void endDocument() {
/*  84 */         super.endDocument();
/*  85 */         if (this.val$autoClose[0] != null) {
/*     */           try {
/*  87 */             this.val$autoClose[0].close();
/*     */           } catch (IOException e) {
/*  89 */             throw new TxwException(e);
/*     */           }
/*  91 */           this.val$autoClose[0] = null;
/*     */         }
/*     */       } } ;
/*     */   }
View Full Code Here

/*     */   public void flush() {
/* 158 */     this.serializer.flush();
/*     */     try {
/* 160 */       this.writer.flush();
/*     */     } catch (IOException e) {
/* 162 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

        splitParameters(bodyParams, headerParams, method.getRequestParameters());
        SOAPBinding soapBinding = method.getBinding();
        operation.soapOperation().soapAction(soapBinding.getSOAPAction());

        // input
        TypedXmlWriter input = operation.input();
        extension.addBindingOperationInputExtension(input, method);
        BodyType body = input._element(Body.class);
        boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
        if (soapBinding.getUse() == Use.LITERAL) {
            body.use(LITERAL);
            if (headerParams.size() > 0) {
                if (bodyParams.size() > 0) {
                    ParameterImpl param = bodyParams.iterator().next();
                    if (isRpc) {
                        StringBuilder parts = new StringBuilder();
                        int i = 0;
                        for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) {
                            if (i++ > 0)
                                parts.append(' ');
                            parts.append(parameter.getPartName());
                        }
                        body.parts(parts.toString());
                    } else {
                        body.parts(param.getPartName());
                    }
                } else {
                    body.parts("");
                }
                generateSOAPHeaders(input, headerParams, requestMessage);
            }
            if (isRpc) {
                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
            }
        } else {
            // TODO localize this
            throw new WebServiceException("encoded use is not supported");
        }

        if (method.getMEP() != MEP.ONE_WAY) {
            // output
            bodyParams.clear();
            headerParams.clear();
            splitParameters(bodyParams, headerParams, method.getResponseParameters());
            TypedXmlWriter output = operation.output();
            extension.addBindingOperationOutputExtension(output, method);
            body = output._element(Body.class);
            body.use(LITERAL);
            if (headerParams.size() > 0) {
                StringBuilder parts = new StringBuilder();
                if (bodyParams.size() > 0) {
                    ParameterImpl param = bodyParams.iterator().hasNext() ? bodyParams.iterator().next() : null;
View Full Code Here

        if (soapAction != null) {
            operation.soap12Operation().soapAction(soapAction);
        }

        // input
        TypedXmlWriter input = operation.input();
        extension.addBindingOperationInputExtension(input, method);
        com.sun.xml.ws.wsdl.writer.document.soap12.BodyType body = input._element(com.sun.xml.ws.wsdl.writer.document.soap12.Body.class);
        boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
        if (soapBinding.getUse().equals(Use.LITERAL)) {
            body.use(LITERAL);
            if (headerParams.size() > 0) {
                if (bodyParams.size() > 0) {
                    ParameterImpl param = bodyParams.iterator().next();
                    if (isRpc) {
                        StringBuilder parts = new StringBuilder();
                        int i = 0;
                        for (ParameterImpl parameter : ((WrapperParameter) param).getWrapperChildren()) {
                            if (i++ > 0)
                                parts.append(' ');
                            parts.append(parameter.getPartName());
                        }
                        body.parts(parts.toString());
                    } else {
                        body.parts(param.getPartName());
                    }
                } else {
                    body.parts("");
                }
                generateSOAP12Headers(input, headerParams, requestMessage);
            }
            if (isRpc) {
                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
            }
        } else {
            // TODO localize this
            throw new WebServiceException("encoded use is not supported");
        }

        if (method.getMEP() != MEP.ONE_WAY) {
            // output
            bodyParams.clear();
            headerParams.clear();
            splitParameters(bodyParams, headerParams, method.getResponseParameters());
            TypedXmlWriter output = operation.output();
            extension.addBindingOperationOutputExtension(output, method);
            body = output._element(com.sun.xml.ws.wsdl.writer.document.soap12.Body.class);
            body.use(LITERAL);
            if (headerParams.size() > 0) {
                if (bodyParams.size() > 0) {
                    ParameterImpl param = bodyParams.iterator().next();
                    if (isRpc) {
View Full Code Here

TOP

Related Classes of com.sun.xml.txw2.annotation.XmlElement

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.