Package org.objectweb.celtix.bindings.xmlformat

Examples of org.objectweb.celtix.bindings.xmlformat.TBody


    private void addWrapperRoot(XMLMessage xmlMessage, DataBindingCallback callback) throws WSDLException {
        BindingOperation operation = getBindingOperation(callback.getOperationName());
       
        BindingInput input = operation.getBindingInput();

        TBody xmlBinding = null;
        Iterator ite = input.getExtensibilityElements().iterator();
        while (ite.hasNext()) {
            Object obj = ite.next();
            if (obj instanceof TBody) {
                xmlBinding = (TBody)obj;
            }
        }

        if (needRootNode(operation, false)) {
            if (xmlBinding == null || xmlBinding.getRootNode() == null) {
                throw new XMLBindingException("Bare style must define the rootNode in this case!");
            }
            QName rootNode = xmlBinding.getRootNode();
            Document doc = xmlMessage.getRoot();
            String targetNamespace = rootNode.getNamespaceURI() == null
                ? callback.getTargetNamespace() : rootNode.getNamespaceURI();
            Element operationNode = doc.createElementNS(targetNamespace, rootNode.getLocalPart());
            xmlMessage.appendChild(operationNode);
View Full Code Here


    private void addReturnWrapperRoot(XMLMessage xmlMessage,
                                      DataBindingCallback callback) throws WSDLException {
        BindingOperation operation = getBindingOperation(callback.getOperationName());

        BindingOutput output = operation.getBindingOutput();
        TBody xmlBinding = null;
        Iterator ite = output.getExtensibilityElements().iterator();
        while (ite.hasNext()) {
            Object obj = ite.next();
            if (obj instanceof TBody) {
                xmlBinding = (TBody)obj;
            }
        }
        if (needRootNode(operation, true)) {
            if (xmlBinding == null || xmlBinding.getRootNode() == null) {
                throw new XMLBindingException("Bare style must define the rootNode in this case!");
            }
            QName rootNode = xmlBinding.getRootNode();
            Document doc = xmlMessage.getRoot();
            String targetNamespace = rootNode.getNamespaceURI() == null
                ? callback.getTargetNamespace() : rootNode.getNamespaceURI();
            Element operationNode = doc.createElementNS(targetNamespace, rootNode.getLocalPart());
            xmlMessage.appendChild(operationNode);
View Full Code Here

        BindingOperation operation = binding.getBindingOperation("sayHi", "sayHiRequest", "sayHiResponse");
        assertNotNull(operation);
        BindingInput input = operation.getBindingInput();
        assertNotNull(input);

        TBody xmlBinding = null;
        Iterator ite = input.getExtensibilityElements().iterator();
        while (ite.hasNext()) {
            Object obj = ite.next();
            if (obj instanceof TBody) {
                xmlBinding = (TBody)obj;
            }
        }
        assertNotNull(xmlBinding);
        assertEquals(new QName("http://objectweb.org/hello_world_xml_http/bare", "sayHi"),
                     xmlBinding.getRootNode());
    }
View Full Code Here

        BindingOperation operation = b.getBindingOperation("sayHi", "sayHiRequest", "sayHiResponse");
        assertNotNull(operation);
        BindingInput input = operation.getBindingInput();
        assertNotNull(input);
       
        TBody xmlBinding = null;
        Iterator ite = input.getExtensibilityElements().iterator();
        while (ite.hasNext()) {
            Object obj = ite.next();
            if (obj instanceof TBody) {
                xmlBinding = (TBody)obj;
            }
        }
        assertNotNull(xmlBinding);
        assertEquals(new QName("http://objectweb.org/hello_world_xml_http/bare", "sayHi"),
                     xmlBinding.getRootNode());
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.bindings.xmlformat.TBody

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.