Examples of toDOMNode()


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

        PostMethod method = new PostMethod("http://localhost:8193/ep2/");
        method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request-12.xml")));
        int state = new HttpClient().executeMethod(method);
        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, state);
        SourceTransformer st = new SourceTransformer();
        Node node = st.toDOMNode(new StreamSource(method.getResponseBodyAsStream()));
        logger.info(st.toString(node));

        Element e = ((Document) node).getDocumentElement();
        assertEquals(new QName(SoapMarshaler.SOAP_12_URI, SoapMarshaler.ENVELOPE), DOMUtil.getQName(e));
        e = DOMUtil.getFirstChildElement(e);
View Full Code Here

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

        return elem;
    }
 
    private Node getDOMNode(Source source) throws Exception {
      SourceTransformer sourceTransformer = new SourceTransformer();
      Node node = sourceTransformer.toDOMNode(source);
        if (node.getNodeType() == Node.DOCUMENT_NODE) {
          node = ((Document)node).getDocumentElement();
        }
        return node;
    }
View Full Code Here

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

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

                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

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

        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

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

        }
        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.