Package org.servicemix.jbi.jaxp

Examples of org.servicemix.jbi.jaxp.SourceTransformer.toDOMNode()


            // put service description
            try {
                SourceTransformer st = new SourceTransformer();
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                component.getXFire().generateWSDL(svc.getName(), baos);
                Node node = st.toDOMNode(new StreamSource(new ByteArrayInputStream(baos.toByteArray())));
                Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, (Document) node);
                javax.wsdl.Service service = d.getService(serviceName);
                if (service != null) {
                    if (service.getPorts().values().size() == 1) {
                        endpointName = ((Port) service.getPorts().values().iterator().next()).getName();
View Full Code Here


                Set<Entry<String, DocInfo>> entries = docs.entrySet();
                for (Entry<String, DocInfo> entry : entries) {
                    DocInfo docInfo = (DocInfo)entry.getValue();
                    DOC_TYPE docType = docInfo.getDocType();
                    if (docType == DOC_TYPE.WSDL) {
                        Node node = st.toDOMNode(new StreamSource(docInfo.getDoc()));
                        component.setServiceDescription(es.getServiceName(), es.getEndpointName(), (Document) node);
                        if (logger.isDebugEnabled()) {
                            logger.debug("WSDL: " + st.toString(node));
                        }
                    }
View Full Code Here

        SourceTransformer transformer = new SourceTransformer();
        QName serviceName = new QName("http://jaxws.components.servicemix.org/", "AddNumbersImplService");
        String file = "requestWithEnvelope.xml";
        Object answer = requestServiceWithFileRequest(serviceName, file);
        if (answer instanceof Source) {
            answer = transformer.toDOMNode((Source) answer);
        }
        assertTrue("Should return a DOM Node: " + answer, answer instanceof Node);
        Node node = (Node) answer;
        System.out.println(transformer.toString(node));
        String text = textValueOfXPath(node, "//return").trim();
View Full Code Here

        }
        public DocumentFragment getAsReference(QName operationName) {
            try {
                SourceTransformer st = new SourceTransformer();
                String xml = new XStream(new DomDriver()).toXML(this);
                Document doc = (Document) st.toDOMNode(new StringSource(xml));
                DocumentFragment df = doc.createDocumentFragment();
                df.appendChild(doc.getDocumentElement());
                return df;
            } catch (Exception e) {
                throw new RuntimeException(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.