<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:52:24 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[CONTROLLER-185] BI Broker fails to serve remote rpc call</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-185</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;The call fails at checkArgument() below. &#8220;inputContainer&#8221; is null.&lt;/p&gt;

&lt;p&gt;public RpcResult&amp;lt;CompositeNode&amp;gt; invokeRpc(QName rpc, CompositeNode input) {&lt;br/&gt;
            CompositeNode inputContainer = input.getFirstCompositeByName(QName.create(rpc,&quot;input&quot;));&lt;br/&gt;
           checkArgument(inputContainer != null, &quot;Rpc payload must contain input element&#8221;);&lt;/p&gt;

&lt;p&gt;Debugging deeper, I found that MutableCompositeNodeTOImpl could not find &#8220;children&#8221; in nodeMap. The key &#8220;QName&quot; in the NodeMap is different than the key &#8220;children&#8221; used to lookup. &lt;br/&gt;
public List&amp;lt;CompositeNode&amp;gt; getCompositesByName(QName children) {&lt;br/&gt;
        List&amp;lt;Node&amp;lt;?&amp;gt;&amp;gt; toFilter = getNodeMap().get(children);&lt;/p&gt;


&lt;p&gt;The QName sent by remote rpc router looks like:&lt;br/&gt;
{&lt;br/&gt;
   namespace: &quot;urn:opendaylight:flow:service&quot;&lt;br/&gt;
   localname: &quot;input&quot;&lt;br/&gt;
   prefix: &quot;&quot;&lt;br/&gt;
   formattedRevision: null&lt;br/&gt;
   revision: null&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;While the key for flow service in NodeMap looks like:&lt;br/&gt;
{&lt;br/&gt;
   namespace: &quot;urn:opendaylight:flow:service&quot;&lt;br/&gt;
   localname: &quot;input&quot;&lt;br/&gt;
   prefix: &quot;flow&quot;&lt;br/&gt;
   formattedRevision: &quot;2013-08-19&quot;&lt;br/&gt;
   revision: &quot;Mon Aug 19 00:00:00 GMT-08:00 2013&quot;&lt;br/&gt;
}&lt;/p&gt;



&lt;p&gt;My RESTConf payload is:&lt;br/&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&amp;gt;&lt;br/&gt;
&amp;lt;flow xmlns=&quot;urn:opendaylight:flow:inventory&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;priority&amp;gt;5&amp;lt;/priority&amp;gt;&lt;br/&gt;
    &amp;lt;flow-name&amp;gt;Foo&amp;lt;/flow-name&amp;gt;&lt;br/&gt;
    &amp;lt;match&amp;gt;&lt;br/&gt;
        &amp;lt;ethernet-match&amp;gt;&lt;br/&gt;
            &amp;lt;ethernet-type&amp;gt;&lt;br/&gt;
                &amp;lt;type&amp;gt;2048&amp;lt;/type&amp;gt;&lt;br/&gt;
            &amp;lt;/ethernet-type&amp;gt;&lt;br/&gt;
        &amp;lt;/ethernet-match&amp;gt;&lt;br/&gt;
        &amp;lt;ipv4-destination&amp;gt;10.0.10.2/24&amp;lt;/ipv4-destination&amp;gt;&lt;br/&gt;
    &amp;lt;/match&amp;gt;&lt;br/&gt;
    &amp;lt;id&amp;gt;4&amp;lt;/id&amp;gt;&lt;br/&gt;
    &amp;lt;table_id&amp;gt;4&amp;lt;/table_id&amp;gt;&lt;br/&gt;
    &amp;lt;instructions&amp;gt;&lt;br/&gt;
        &amp;lt;instruction&amp;gt;&lt;br/&gt;
            &amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&lt;br/&gt;
            &amp;lt;apply-actions&amp;gt;&lt;br/&gt;
                &amp;lt;action&amp;gt;&lt;br/&gt;
                   &amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&lt;br/&gt;
                   &amp;lt;dec-nw-ttl/&amp;gt;&lt;br/&gt;
                &amp;lt;/action&amp;gt;&lt;br/&gt;
            &amp;lt;/apply-actions&amp;gt;&lt;br/&gt;
        &amp;lt;/instruction&amp;gt;&lt;br/&gt;
    &amp;lt;/instructions&amp;gt;&lt;br/&gt;
&amp;lt;/flow&amp;gt;&lt;/p&gt;

&lt;p&gt;The payload that I get in remote rpc router is&lt;br/&gt;
&amp;lt;add-flow xmlns=&quot;urn:opendaylight:flow:service&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;input&amp;gt;&lt;br/&gt;
    &amp;lt;transaction-uri&amp;gt;BA-7&amp;lt;/transaction-uri&amp;gt;&lt;br/&gt;
    &amp;lt;table_id&amp;gt;4&amp;lt;/table_id&amp;gt;&lt;br/&gt;
    &amp;lt;priority&amp;gt;5&amp;lt;/priority&amp;gt;&lt;br/&gt;
    &amp;lt;node&amp;gt;&lt;br/&gt;
      /(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}
&lt;p&gt;]&lt;br/&gt;
    &amp;lt;/node&amp;gt;&lt;br/&gt;
    &amp;lt;match&amp;gt;&lt;br/&gt;
      &amp;lt;ipv4-destination&amp;gt;10.0.10.2/24&amp;lt;/ipv4-destination&amp;gt;&lt;br/&gt;
      &amp;lt;ethernet-match&amp;gt;&lt;br/&gt;
        &amp;lt;ethernet-type&amp;gt;&lt;br/&gt;
          &amp;lt;type&amp;gt;2048&amp;lt;/type&amp;gt;&lt;br/&gt;
        &amp;lt;/ethernet-type&amp;gt;&lt;br/&gt;
      &amp;lt;/ethernet-match&amp;gt;&lt;br/&gt;
    &amp;lt;/match&amp;gt;&lt;br/&gt;
    &amp;lt;instructions&amp;gt;&lt;br/&gt;
      &amp;lt;instruction&amp;gt;&lt;br/&gt;
        &amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&lt;br/&gt;
        &amp;lt;apply-actions&amp;gt;&lt;br/&gt;
          &amp;lt;action&amp;gt;&lt;br/&gt;
            &amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&lt;br/&gt;
            &amp;lt;dec-nw-ttl/&amp;gt;&lt;br/&gt;
          &amp;lt;/action&amp;gt;&lt;br/&gt;
        &amp;lt;/apply-actions&amp;gt;&lt;br/&gt;
      &amp;lt;/instruction&amp;gt;&lt;br/&gt;
    &amp;lt;/instructions&amp;gt;&lt;br/&gt;
    &amp;lt;flow-table&amp;gt;&lt;br/&gt;
      /(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)table[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=4}
&lt;p&gt;]&lt;br/&gt;
    &amp;lt;/flow-table&amp;gt;&lt;br/&gt;
    &amp;lt;flow-ref&amp;gt;&lt;br/&gt;
      /(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)table[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=4}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)flow[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=4}
&lt;p&gt;]&lt;br/&gt;
    &amp;lt;/flow-ref&amp;gt;&lt;br/&gt;
    &amp;lt;flow-name&amp;gt;Foo&amp;lt;/flow-name&amp;gt;&lt;br/&gt;
  &amp;lt;/input&amp;gt;&lt;br/&gt;
&amp;lt;/add-flow&amp;gt;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="24739">CONTROLLER-185</key>
            <summary>BI Broker fails to serve remote rpc call</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="10004" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Verified</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="mmarsale@cisco.com">Maros Marsalek</assignee>
                                    <reporter username="abhishk2@cisco.com">Abhishek Kumar</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Feb 2014 19:13:49 +0000</created>
                <updated>Tue, 25 Jul 2023 08:23:09 +0000</updated>
                            <resolved>Tue, 29 Jul 2014 16:27:14 +0000</resolved>
                                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="47693" author="tony.tkacik@gmail.com" created="Thu, 27 Feb 2014 13:58:44 +0000"  >&lt;p&gt;The contract of MD-SAL requires QNames always contain information according to the schema: this means namespace, revision, local-name.&lt;/p&gt;

&lt;p&gt;If this is not present, MD-SAL could not distinguish between two different revisions and thus do the correct processing.&lt;/p&gt;

&lt;p&gt;ZeroMQ should send QNames with revision, also all data upstreamed to MD-SAL&lt;br/&gt;
should contain revision information. Otherwise MD-SAL is not able to process that.&lt;/p&gt;

&lt;p&gt;If you are using w3c Document as payload and XmlDocumentUtils to convert it to yang data - consider using SchemaService from ProviderContext to learn the schema, and then use corresponding methods&lt;br/&gt;
from XmlDocumentUtils which takes DataSchemaNode or SchemaContext as argument for normalization (and verification)of XmlDocument.&lt;/p&gt;</comment>
                            <comment id="47694" author="tony.tkacik@gmail.com" created="Thu, 27 Feb 2014 14:37:47 +0000"  >&lt;p&gt;Abhishek please provide additional information which serialization / deserialization method are you using.&lt;/p&gt;</comment>
                            <comment id="47695" author="abhishk2@cisco.com" created="Thu, 27 Feb 2014 18:40:01 +0000"  >&lt;p&gt;Tony,&lt;/p&gt;

&lt;p&gt;Ser/DSer code is in this class:&lt;br/&gt;
org.opendaylight.controller.sal.connector.remoterpc.util.XmlUtils&lt;/p&gt;

&lt;p&gt;Let me know if this is not appropriate.&lt;/p&gt;

&lt;p&gt;Copy/Pasting the code:&lt;/p&gt;

&lt;p&gt;  public static String compositeNodeToXml(CompositeNode cNode){&lt;br/&gt;
    if (cNode == null) return new String();&lt;/p&gt;

&lt;p&gt;    Document domTree = NodeUtils.buildShadowDomTree(cNode);&lt;br/&gt;
    StringWriter writer = new StringWriter();&lt;br/&gt;
    try &lt;/p&gt;
{
      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer transformer = tf.newTransformer();
      transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, &quot;yes&quot;);
      transformer.transform(new DOMSource(domTree), new StreamResult(writer));
    }
&lt;p&gt; catch (TransformerException e) &lt;/p&gt;
{
      _logger.error(&quot;Error during translation of Document to OutputStream&quot;, e);
    }

&lt;p&gt;    return writer.toString();&lt;br/&gt;
  }&lt;/p&gt;

&lt;p&gt;  public static CompositeNode xmlToCompositeNode(String xml){&lt;br/&gt;
    if (xml==null || xml.length()==0) return null;&lt;/p&gt;

&lt;p&gt;    Node&amp;lt;?&amp;gt; dataTree;&lt;br/&gt;
    try &lt;/p&gt;
{
      dataTree = XmlTreeBuilder.buildDataTree(new ByteArrayInputStream(xml.getBytes()));
    }
&lt;p&gt; catch (XMLStreamException e) &lt;/p&gt;
{
      _logger.error(&quot;Error during building data tree from XML&quot;, e);
      return null;
    }
&lt;p&gt;    if (dataTree == null) &lt;/p&gt;
{
      _logger.error(&quot;data tree is null&quot;);
      return null;
    }
&lt;p&gt;    if (dataTree instanceof SimpleNode) &lt;/p&gt;
{
      _logger.error(&quot;RPC XML was resolved as SimpleNode&quot;);
      return null;
    }
&lt;p&gt;    return (CompositeNode) dataTree;&lt;br/&gt;
  }&lt;/p&gt;</comment>
                            <comment id="47696" author="vmithbao@cisco.com" created="Wed, 7 May 2014 17:12:43 +0000"  >&lt;p&gt;Hi Tony,&lt;/p&gt;

&lt;p&gt;We followed your suggestions in the &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-185&quot; title=&quot;BI Broker fails to serve remote rpc call&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-185&quot;&gt;&lt;del&gt;CONTROLLER-185&lt;/del&gt;&lt;/a&gt; notes to use XMLDocumentUtil methods for serialization, deserialization. We first get the ProviderSession, then get SchemaService from it, and get SchemaContext from the SchemaService.&lt;br/&gt;
We tried using following methods&lt;/p&gt;

&lt;p&gt;public static Document toDocument(CompositeNode data, DataNodeContainer schema, XmlCodecProvider codecProvider) (for converting CompositeNode to XML Document, and that works fine&lt;/p&gt;

&lt;p&gt;But other way round we used following method, as that was the only suitable option&lt;/p&gt;

&lt;p&gt;public static Node&amp;lt;?&amp;gt; toDomNode(Element xmlElement, Optional&amp;lt;DataSchemaNode&amp;gt; schema,&lt;br/&gt;
            Optional&amp;lt;XmlCodecProvider&amp;gt; codecProvider) {&lt;/p&gt;

&lt;p&gt;But it seems this method at&lt;br/&gt;
checkQName(xmlElement, schema.getQName());&lt;/p&gt;

&lt;p&gt;Since the qName of both parameters are not equal. Following is the code which calls respective methods of XMLDocumentUtils, see the red highlighted lines.  We need your guidance on how to proceed further, or is there any other method from XMLDocumentUtils that you had in mind?&lt;br/&gt;
We saw that toCompositeNodeWithSchema is private and can&apos;t be used.&lt;/p&gt;


&lt;p&gt;/*&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;This program and the accompanying materials are made available under the&lt;/li&gt;
	&lt;li&gt;terms of the Eclipse Public License v1.0 which accompanies this distribution,&lt;/li&gt;
	&lt;li&gt;and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;&lt;br/&gt;
 */&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;package org.opendaylight.controller.sal.connector.remoterpc.util;&lt;/p&gt;

&lt;p&gt;import java.io.IOException;&lt;br/&gt;
import javax.xml.parsers.ParserConfigurationException;&lt;br/&gt;
import javax.activation.UnsupportedDataTypeException;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.api.Node;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.api.SimpleNode;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.impl.NodeUtils;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.impl.XmlTreeBuilder;&lt;br/&gt;
import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils;&lt;br/&gt;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;&lt;br/&gt;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;&lt;br/&gt;
import org.opendaylight.controller.netconf.util.xml.XmlUtil;&lt;br/&gt;
import org.slf4j.Logger;&lt;br/&gt;
import org.slf4j.LoggerFactory;&lt;br/&gt;
import org.w3c.dom.Document;&lt;br/&gt;
import org.xml.sax.InputSource;&lt;br/&gt;
import javax.xml.stream.XMLStreamException;&lt;br/&gt;
import javax.xml.transform.OutputKeys;&lt;br/&gt;
import javax.xml.transform.Transformer;&lt;br/&gt;
import javax.xml.transform.TransformerException;&lt;br/&gt;
import javax.xml.transform.TransformerFactory;&lt;br/&gt;
import javax.xml.transform.dom.DOMSource;&lt;br/&gt;
import javax.xml.transform.stream.StreamResult;&lt;br/&gt;
import java.io.ByteArrayInputStream;&lt;br/&gt;
import java.io.StringWriter;&lt;br/&gt;
import org.xml.sax.SAXException;&lt;br/&gt;
import java.io.StringReader;&lt;br/&gt;
import com.google.common.base.Optional;&lt;br/&gt;
public class XmlUtils {&lt;/p&gt;

&lt;p&gt;  private static final Logger _logger = LoggerFactory.getLogger(XmlUtils.class);&lt;/p&gt;

&lt;p&gt;  public static String compositeNodeToXml(CompositeNode cNode, SchemaContext schemaContext){&lt;br/&gt;
    if (cNode == null) return new String();&lt;/p&gt;

&lt;p&gt;    //Document domTree = NodeUtils.buildShadowDomTree(cNode);&lt;br/&gt;
    Document domTree = null;&lt;br/&gt;
    try &lt;/p&gt;
{
      domTree = XmlDocumentUtils.toDocument(cNode, schemaContext, XmlDocumentUtils.defaultValueCodecProvider());
    }
&lt;p&gt; catch (UnsupportedDataTypeException e) &lt;/p&gt;
{
      _logger.error(&quot;Error during translation of CompositeNode to Document&quot;, e);
    }
&lt;p&gt;    StringWriter writer = new StringWriter();&lt;br/&gt;
    try &lt;/p&gt;
{
      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer transformer = tf.newTransformer();
      transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, &quot;yes&quot;);
      transformer.transform(new DOMSource(domTree), new StreamResult(writer));
    }
&lt;p&gt; catch (TransformerException e) &lt;/p&gt;
{

      _logger.error(&quot;Error during translation of Document to OutputStream&quot;, e);
    }
&lt;p&gt;    _logger.debug(&quot;compositeNodeToXml &quot; + writer.toString());&lt;/p&gt;

&lt;p&gt;    return writer.toString();&lt;/p&gt;

&lt;p&gt;  }&lt;/p&gt;

&lt;p&gt;  public static CompositeNode xmlToCompositeNode(String xml,  SchemaContext schemaContext){&lt;br/&gt;
    if (xml==null || xml.length()==0) return null;&lt;/p&gt;

&lt;p&gt;    Node&amp;lt;?&amp;gt; dataTree = null;&lt;br/&gt;
    try &lt;/p&gt;
{

        Document doc = null;

      doc = XmlUtil.readXmlToDocument(xml);
      _logger.debug(&quot;vaishali xmlToCompositeNode Document is &quot; + xml );
      dataTree = XmlDocumentUtils.toDomNode(doc.getDocumentElement(), Optional.&amp;lt;DataSchemaNode&amp;gt;of(schemaContext), Optional.of(XmlDocumentUtils.defaultValueCodecProvider()));
   
    }
&lt;p&gt; catch (SAXException e) &lt;/p&gt;
{
      _logger.error(&quot;Error during building data tree from XML&quot;, e);
    } catch (IOException e) {      _logger.error(&quot;Error during building data tree from XML&quot;, e);    }

&lt;p&gt;    _logger.debug(&quot;xmlToCompositeNode &quot; + dataTree.toString());&lt;br/&gt;
    return (CompositeNode) dataTree;&lt;br/&gt;
  }&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;Thanks,&lt;br/&gt;
Vaishali&lt;/p&gt;</comment>
                            <comment id="47697" author="tony.tkacik@gmail.com" created="Tue, 20 May 2014 14:24:47 +0000"  >&lt;p&gt;Using SchemaContext only payload is assumed to be data tree, not RPC one.&lt;/p&gt;

&lt;p&gt;You may want to search SchemaContext for definition of that RPC&lt;br/&gt;
and then getInput/getOutput from Rpc Definition and pass that as an&lt;br/&gt;
argument to xml serialization/deserialization - so the XmlDocumentUtils&lt;br/&gt;
knows that your data needs to comform to that specific RPC definition&lt;br/&gt;
not global data tree definition.&lt;/p&gt;</comment>
                            <comment id="47698" author="tony.tkacik@gmail.com" created="Wed, 2 Jul 2014 09:14:07 +0000"  >&lt;p&gt;Offending component was removed.&lt;/p&gt;</comment>
                            <comment id="47699" author="harmasin@cisco.com" created="Mon, 21 Jul 2014 23:06:11 +0000"  >&lt;p&gt;Reopening the defect. I am trying to use it in RPC clustering.&lt;/p&gt;

&lt;p&gt;Tony, &lt;/p&gt;

&lt;p&gt;The comments you mentioned, i tried to use them like following&lt;/p&gt;

&lt;p&gt; public static String inputCompositeNodeToXml(CompositeNode cNode, SchemaContext schemaContext){&lt;br/&gt;
    if (cNode == null) return new String();&lt;/p&gt;

&lt;p&gt;    //Document domTree = NodeUtils.buildShadowDomTree(cNode);&lt;br/&gt;
    Document domTree = null;&lt;br/&gt;
    try {&lt;br/&gt;
      Set&amp;lt;RpcDefinition&amp;gt; rpcs =  schemaContext.getOperations();&lt;br/&gt;
      for(RpcDefinition rpc : rpcs) {&lt;br/&gt;
        if(rpc.getQName().equals(cNode.getNodeType()))&lt;/p&gt;
{
          domTree = XmlDocumentUtils.toDocument(cNode, rpc.getInput(), XmlDocumentUtils.defaultValueCodecProvider());
          break;
        }
&lt;p&gt;      }&lt;/p&gt;

&lt;p&gt;    } catch (UnsupportedDataTypeException e) &lt;/p&gt;
{
      LOG.error(&quot;Error during translation of CompositeNode to Document&quot;, e);
    }
&lt;p&gt;    return domTransformer(domTree);&lt;br/&gt;
  }&lt;/p&gt;

&lt;p&gt;public static CompositeNode inputXmlToCompositeNode(QName rpc, String xml,  SchemaContext schemaContext){&lt;br/&gt;
    if (xml==null || xml.length()==0) return null;&lt;/p&gt;

&lt;p&gt;    Node&amp;lt;?&amp;gt; dataTree = null;&lt;br/&gt;
    try {&lt;/p&gt;

&lt;p&gt;      Document doc = XmlUtil.readXmlToDocument(xml);&lt;br/&gt;
      LOG.debug(&quot;xmlToCompositeNode Document is &quot; + xml );&lt;br/&gt;
      Set&amp;lt;RpcDefinition&amp;gt; rpcs =  schemaContext.getOperations();&lt;br/&gt;
      for(RpcDefinition rpcDef : rpcs) {&lt;br/&gt;
        if(rpcDef.getQName().equals(rpc))&lt;/p&gt;
{
          dataTree = XmlDocumentUtils.toDomNode(doc.getDocumentElement(), Optional.&amp;lt;DataSchemaNode&amp;gt;of(rpcDef.getInput()), Optional.of(XmlDocumentUtils.defaultValueCodecProvider()));
          break;
        }
&lt;p&gt;      }&lt;br/&gt;
    } catch (SAXException e) &lt;/p&gt;
{
      LOG.error(&quot;Error during building data tree from XML&quot;, e);
    } catch (IOException e) {      LOG.error(&quot;Error during building data tree from XML&quot;, e);    }

&lt;p&gt;    LOG.debug(&quot;xmlToCompositeNode &quot; + dataTree.toString());&lt;br/&gt;
    return (CompositeNode) dataTree;&lt;br/&gt;
  }&lt;/p&gt;


&lt;p&gt;It works fine while node to xml conversation and give me output, something like this&lt;/p&gt;

&lt;p&gt;&amp;lt;add-flow xmlns=&quot;urn:opendaylight:flow:service&quot;&amp;gt;&amp;lt;input&amp;gt;&amp;lt;flow-name&amp;gt;Foo&amp;lt;/flow-name&amp;gt;&amp;lt;flow-ref&amp;gt;(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:249485023638597}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)table[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=3}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)flow[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=155}
&lt;p&gt;]&amp;lt;/flow-ref&amp;gt;&amp;lt;flow-table&amp;gt;(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:249485023638597}
&lt;p&gt;]/(urn:opendaylight:flow:inventory?revision=2013-08-19)table[&lt;/p&gt;
{(urn:opendaylight:flow:inventory?revision=2013-08-19)id=3}
&lt;p&gt;]&amp;lt;/flow-table&amp;gt;&amp;lt;instructions&amp;gt;&amp;lt;instruction&amp;gt;&amp;lt;apply-actions&amp;gt;&amp;lt;action&amp;gt;&amp;lt;dec-nw-ttl/&amp;gt;&amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&amp;lt;/action&amp;gt;&amp;lt;/apply-actions&amp;gt;&amp;lt;order&amp;gt;0&amp;lt;/order&amp;gt;&amp;lt;/instruction&amp;gt;&amp;lt;/instructions&amp;gt;&amp;lt;match&amp;gt;&amp;lt;ethernet-match&amp;gt;&amp;lt;ethernet-type&amp;gt;&amp;lt;type&amp;gt;2048&amp;lt;/type&amp;gt;&amp;lt;/ethernet-type&amp;gt;&amp;lt;/ethernet-match&amp;gt;&amp;lt;ipv4-destination&amp;gt;10.0.0.2/24&amp;lt;/ipv4-destination&amp;gt;&amp;lt;/match&amp;gt;&amp;lt;node&amp;gt;(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[&lt;/p&gt;
{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:249485023638597}
&lt;p&gt;]&amp;lt;/node&amp;gt;&amp;lt;priority&amp;gt;2&amp;lt;/priority&amp;gt;&amp;lt;table_id&amp;gt;3&amp;lt;/table_id&amp;gt;&amp;lt;transaction-uri&amp;gt;DOM-1&amp;lt;/transaction-uri&amp;gt;&amp;lt;/input&amp;gt;&amp;lt;/add-flow&amp;gt;&lt;/p&gt;


&lt;p&gt;But it still throws illegalArgument Exception when converting xml to DomNode on the second node.&lt;/p&gt;</comment>
                            <comment id="47700" author="mmarsale@cisco.com" created="Mon, 28 Jul 2014 13:27:05 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have added a test to transform the input for an RPC using XmlDocumentUtils (I also tried the xml you provided):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/9380/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/9380/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It worked fine so could you please provide the exact data you are transforming ? And could you also provide your code (as a gerrit draft or give me a pointer) that I can reproduce and debug the issue ?&lt;/p&gt;</comment>
                            <comment id="47701" author="harmasin@cisco.com" created="Mon, 28 Jul 2014 16:47:13 +0000"  >&lt;p&gt;Actually, CompositeNode to XML transformation works fine for me also, its the other way around, which does not work fine. When i try to convert XML to composite node, it does create the Node, but the values inside instance identifier are not converted based on type, they are always String. &lt;/p&gt;

&lt;p&gt;Say in Add flow RPC, i have table id in flow-ref instanceidentifier, which should get converted to Short type, but it always gives me String&lt;/p&gt;</comment>
                            <comment id="47702" author="mmarsale@cisco.com" created="Tue, 29 Jul 2014 06:32:24 +0000"  >&lt;p&gt;I see.&lt;/p&gt;

&lt;p&gt;I have fixed the issue in the commit I posted (there is also a test to prove it):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/9380/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/9380/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Could you please verify ? Setting state to: waiting for review&lt;/p&gt;

&lt;p&gt;There was a problem when using derived type of instance identifier, but it is fixed now.&lt;/p&gt;</comment>
                            <comment id="47703" author="harmasin@cisco.com" created="Tue, 29 Jul 2014 16:27:14 +0000"  >&lt;p&gt;Thanks for your fix, this works now for normal use case.&lt;/p&gt;

&lt;p&gt; there was one special case for which it won&apos;t work, I have a fix for that, i&apos;ll try to put patch for same.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="24848">CONTROLLER-294</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>461</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=461]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10301"><![CDATA[Normal]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i02iu7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>