[NETCONF-72] RESTCONF rpc() input XML fails while json equivalent succeeds Created: 24/Sep/15  Updated: 15/Mar/19  Resolved: 15/Oct/15

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: James Gregory Hall Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: All


External issue ID: 4353

 Description   

POST to http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/47-netconf-device/yang-ext:mount/ietf-netconf:get-config

<input xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf">
<source>running</source>
</input>
...
<error-type>protocol</error-type>
<error-tag>malformed-message</error-tag>
<error-message>Error parsing input: Unknown child(ren) node(s) detected, identified by: (urn:ietf:params:xml:ns:yang:ietf-netconf)source, in: container input</error-message>

Try POST :
<input xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf">
<source><running/></source>
</input>
... same error
<error-type>protocol</error-type>
<error-tag>malformed-message</error-tag>
<error-message>Error parsing input: Unknown child(ren) node(s) detected, identified by: (urn:ietf:params:xml:ns:yang:ietf-netconf)source, in: container input</error-message>

Switch to json:

{ "input": { "source" :

{ "running" : "" }

} }

Works!



 Comments   
Comment by James Gregory Hall [ 24/Sep/15 ]

Version is release/lithium

Comment by Vratko Polak [ 01/Oct/15 ]

First lines of ietf-netconf@2011-06-01.yang (either in master branch of netconf repository at opendaylight/netconf/models/ietf-netconf/src/main/yang/, or in stable/lithium branch of controller repository at opendaylight/netconf/ietf-netconf/src/main/yang/) look like this:

module ietf-netconf {

// the namespace for NETCONF XML definitions is unchanged
// from RFC 4741, which this document replaces
namespace "urn:ietf:params:xml:ns:netconf:base:1.0";

In other words, is it possible that XML call fails because your namespace is wrong? It is not listed at http://www.iana.org/assignments/xml-registry/xml-registry.xhtml

Comment by James Gregory Hall [ 15/Oct/15 ]

Thank you for pointing out my Layer 8 error

Generated at Wed Feb 07 20:14:06 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.