We have a netconf enabled router and I am able to perform get/get-config operations using Mg-Soft client browser. This is the output of getConfig() -
REQ:
<nc:get-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<nc:source>
<nc:running/>
</nc:source>
</nc:get-config>
RESP:
<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<qos>
<sap-ingress>
.....
</data>
But I am unable to perform the same operation using tailf Netconf client. Here is my code -
public class Client {
public static void main(String args[]) throws JNCException,
ParserConfigurationException, SAXException, IOException {
DeviceUser deviceUser;
String deviceUserName = "user";
deviceUser = new DeviceUser(deviceUserName, "admin", "admin");
Device device = new Device("simulator", deviceUser, "10.135.16.13", 830);
device.connect(deviceUserName);
device.newSession(new Subscriber("simulator"), "mySession");
NetconfSession session = device.getSession("mySession");
NodeSet config = session.getConfig(NetconfSession.RUNNING);
String xmlString = config.toXMLString();
session.closeSession();
System.out.println(xmlString);
}
}
class Subscriber extends IOSubscriber {
String devName;
public static boolean rawMode = false;
Subscriber(String devName) {
super(rawMode);
this.devName = devName;
}
public void input(String data) {
System.out.println("RECV: " + data);
}
public void output(String data) {
System.out.println("SEND: " + data);
}
}
I am getting the following in the eclipse console -
SEND: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>
RECV: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
<capability>urn:ietf:params:netconf:capability:url:1.0?scheme=ftp,tftp,file</capability>
<capability>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim&also-supported=report-all</capability>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2011-06-01&features=writable-running,validate,startup,url&deviations=alu-netconf-deviations-r13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:netconf-deviations-r13?module=alu-netconf-deviations-r13&revision=2015-01-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:cli-content-layer-r13?module=alu-cli-content-layer-r13&revision=2015-01-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-r13?module=alu-conf-r13&revision=2016-06-24</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-aaa-r13?module=alu-conf-aaa-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-aa-r13?module=alu-conf-aa-r13&revision=2016-06-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-calltrace-r13?module=alu-conf-calltrace-r13&revision=2016-04-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-card-r13?module=alu-conf-card-r13&revision=2015-10-30</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-cflowd-r13?module=alu-conf-cflowd-r13&revision=2015-01-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-conn-prof-r13?module=alu-conf-conn-prof-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-con-profvlan-r13?module=alu-conf-con-profvlan-r13&revision=2015-08-28</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-cfm-r13?module=alu-conf-eth-cfm-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-ring-r13?module=alu-conf-eth-ring-r13&revision=2014-10-17</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-tunnel-r13?module=alu-conf-eth-tunnel-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-filter-r13?module=alu-conf-filter-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-gmpls-tunnel-r13?module=alu-conf-gmpls-tunnel-r13&revision=2014-12-09</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-ifgrphandler-r13?module=alu-conf-ifgrphandler-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-isa-r13?module=alu-conf-isa-r13&revision=2016-02-29</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-lag-r13?module=alu-conf-lag-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-li-r13?module=alu-conf-li-r13&revision=2016-04-21</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-log-r13?module=alu-conf-log-r13&revision=2016-06-01</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-mcastmgmt-r13?module=alu-conf-mcastmgmt-r13&revision=2015-03-12</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-mirror-r13?module=alu-conf-mirror-r13&revision=2016-01-08</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-oam-pm-r13?module=alu-conf-oam-pm-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-open-flow-r13?module=alu-conf-open-flow-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-r13?module=alu-conf-port-r13&revision=2015-08-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-access-r13?module=alu-conf-port-access-r13&revision=2014-10-31</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-aps-r13?module=alu-conf-port-aps-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-ethernet-r13?module=alu-conf-port-ethernet-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-mbundle-r13?module=alu-conf-port-mbundle-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-network-r13?module=alu-conf-port-network-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-sonetsdh-r13?module=alu-conf-port-sonetsdh-r13&revision=2015-06-11</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-r13?module=alu-conf-port-tdm-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-ds1-r13?module=alu-conf-port-tdm-ds1-r13&revision=2014-12-15</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-ds3-r13?module=alu-conf-port-tdm-ds3-r13&revision=2014-12-15</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-e1-r13?module=alu-conf-port-tdm-e1-r13&revision=2014-12-15</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-e3-r13?module=alu-conf-port-tdm-e3-r13&revision=2014-12-15</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-policy-r13?module=alu-conf-port-policy-r13&revision=2015-12-09</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-pxc-r13?module=alu-conf-pxc-r13&revision=2015-04-24</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-python-r13?module=alu-conf-python-r13&revision=2016-06-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-qos-r13?module=alu-conf-qos-r13&revision=2016-04-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-redundancy-r13?module=alu-conf-redundancy-r13&revision=2016-03-25</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-r13?module=alu-conf-router-r13&revision=2016-05-09</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-bgp-r13?module=alu-conf-router-bgp-r13&revision=2016-06-06</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-dhcps-r13?module=alu-conf-router-dhcps-r13&revision=2015-09-21</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-dhcp6-r13?module=alu-conf-router-dhcp6-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-fspec-r13?module=alu-conf-router-fspec-r13&revision=2015-12-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-gmpls-r13?module=alu-conf-router-gmpls-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-igmp-r13?module=alu-conf-router-igmp-r13&revision=2015-11-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-if-r13?module=alu-conf-router-if-r13&revision=2016-04-29</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-isis-r13?module=alu-conf-router-isis-r13&revision=2016-02-18</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-l2tp-r13?module=alu-conf-router-l2tp-r13&revision=2016-05-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ldp-r13?module=alu-conf-router-ldp-r13&revision=2016-05-02</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-lmp-r13?module=alu-conf-router-lmp-r13&revision=2015-09-08</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mccacpl-r13?module=alu-conf-router-mccacpl-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mld-r13?module=alu-conf-router-mld-r13&revision=2015-09-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mpls-r13?module=alu-conf-router-mpls-r13&revision=2016-04-28</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mpls-tp-r13?module=alu-conf-router-mpls-tp-r13&revision=2015-11-09</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-nat-r13?module=alu-conf-router-nat-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ogvalid-r13?module=alu-conf-router-ogvalid-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ospf-r13?module=alu-conf-router-ospf-r13&revision=2016-06-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ospf3-r13?module=alu-conf-router-ospf3-r13&revision=2016-06-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-pcep-r13?module=alu-conf-router-pcep-r13&revision=2016-03-07</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-pim-r13?module=alu-conf-router-pim-r13&revision=2016-06-07</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-policy-r13?module=alu-conf-router-policy-r13&revision=2016-05-19</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-radprox-r13?module=alu-conf-router-radprox-r13&revision=2015-11-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-rip-r13?module=alu-conf-router-rip-r13&revision=2015-06-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-nhroute-r13?module=alu-conf-router-nhroute-r13&revision=2014-09-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-radvert-r13?module=alu-conf-router-radvert-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-rsvp-r13?module=alu-conf-router-rsvp-r13&revision=2015-06-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-wlan-r13?module=alu-conf-router-wlan-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-wpp-r13?module=alu-conf-router-wpp-r13&revision=2015-03-04</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-saa-r13?module=alu-conf-saa-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-service-r13?module=alu-conf-service-r13&revision=2016-03-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-apipe-r13?module=alu-conf-svc-apipe-r13&revision=2016-02-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-cpipe-r13?module=alu-conf-svc-cpipe-r13&revision=2016-02-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-cust-r13?module=alu-conf-svc-cust-r13&revision=2015-09-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-dynsrv-r13?module=alu-conf-svc-dynsrv-r13&revision=2015-09-11</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-egrmcgroup-r13?module=alu-conf-svc-egrmcgroup-r13&revision=2015-09-11</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-epipe-r13?module=alu-conf-svc-epipe-r13&revision=2016-06-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-fpipe-r13?module=alu-conf-svc-fpipe-r13&revision=2016-02-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-r13?module=alu-conf-svc-ies-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-if-r13?module=alu-conf-svc-ies-if-r13&revision=2016-06-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-subif-r13?module=alu-conf-svc-ies-subif-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ipfix-r13?module=alu-conf-svc-ipfix-r13&revision=2014-09-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ipipe-r13?module=alu-conf-svc-ipipe-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-nat-r13?module=alu-conf-svc-nat-r13&revision=2016-04-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-sdp-r13?module=alu-conf-svc-sdp-r13&revision=2016-05-09</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-template-r13?module=alu-conf-svc-template-r13&revision=2016-04-06</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-upnp-r13?module=alu-conf-svc-upnp-r13&revision=2015-09-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-r13?module=alu-conf-svc-vpls-r13&revision=2016-06-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-igmp-r13?module=alu-conf-svc-vpls-igmp-r13&revision=2014-09-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-macmo-r13?module=alu-conf-svc-vpls-macmo-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-macpr-r13?module=alu-conf-svc-vpls-macpr-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-meshs-r13?module=alu-conf-svc-vpls-meshs-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-mld-r13?module=alu-conf-svc-vpls-mld-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-pim-r13?module=alu-conf-svc-vpls-pim-r13&revision=2015-07-07</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-sap-r13?module=alu-conf-svc-vpls-sap-r13&revision=2016-06-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-split-r13?module=alu-conf-svc-vpls-split-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-spoke-r13?module=alu-conf-svc-vpls-spoke-r13&revision=2016-06-13</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-spb-r13?module=alu-conf-svc-vpls-spb-r13&revision=2016-02-04</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-stp-r13?module=alu-conf-svc-vpls-stp-r13&revision=2014-09-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-r13?module=alu-conf-svc-vprn-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-bgp-r13?module=alu-conf-svc-vprn-bgp-r13&revision=2016-05-04</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-dhcps-r13?module=alu-conf-svc-vprn-dhcps-r13&revision=2015-09-21</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-dhcp6-r13?module=alu-conf-svc-vprn-dhcp6-r13&revision=2016-06-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-fspec-r13?module=alu-conf-svc-vprn-fspec-r13&revision=2016-02-11</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-igmp-r13?module=alu-conf-svc-vprn-igmp-r13&revision=2015-11-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-if-r13?module=alu-conf-svc-vprn-if-r13&revision=2016-06-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-isis-r13?module=alu-conf-svc-vprn-isis-r13&revision=2016-02-18</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-l2tp-r13?module=alu-conf-svc-vprn-l2tp-r13&revision=2016-05-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-mld-r13?module=alu-conf-svc-vprn-mld-r13&revision=2015-10-14</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-nat-r13?module=alu-conf-svc-vprn-nat-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-nwif-r13?module=alu-conf-svc-vprn-nwif-r13&revision=2016-04-29</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svs-vprn-ntp-r13?module=alu-conf-svs-vprn-ntp-r13&revision=2015-05-05</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ospf-r13?module=alu-conf-svc-vprn-ospf-r13&revision=2016-06-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ospf3-r13?module=alu-conf-svc-vprn-ospf3-r13&revision=2016-06-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-pim-r13?module=alu-conf-svc-vprn-pim-r13&revision=2015-08-17</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ptp-r13?module=alu-conf-svc-vprn-ptp-r13&revision=2015-05-22</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vprn-radprox-r13?module=alu-conf-vprn-radprox-r13&revision=2015-06-23</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-rip-r13?module=alu-conf-svc-vprn-rip-r13&revision=2015-06-03</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ripng-r13?module=alu-conf-svc-vprn-ripng-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-radv-r13?module=alu-conf-svc-vprn-radv-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-srcad-r13?module=alu-conf-svc-vprn-srcad-r13&revision=2015-01-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-spoke-r13?module=alu-conf-svc-vprn-spoke-r13&revision=2015-12-17</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-subif-r13?module=alu-conf-svc-vprn-subif-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-wlan-r13?module=alu-conf-svc-vprn-wlan-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-wpp-r13?module=alu-conf-svc-vprn-wpp-r13&revision=2015-03-04</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sflow-r13?module=alu-conf-sflow-r13&revision=2014-09-26</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sfm-r13?module=alu-conf-sfm-r13&revision=2014-10-20</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-subscrmgmt-r13?module=alu-conf-subscrmgmt-r13&revision=2016-06-27</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-submgmt-ludb-r13?module=alu-conf-submgmt-ludb-r13&revision=2016-06-14</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-submgmt-wlangw-r13?module=alu-conf-submgmt-wlangw-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-system-r13?module=alu-conf-system-r13&revision=2016-06-08</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-pwrmgmt-r13?module=alu-conf-sys-pwrmgmt-r13&revision=2015-05-25</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-ptp-r13?module=alu-conf-sys-ptp-r13&revision=2015-06-25</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-sec-r13?module=alu-conf-sys-sec-r13&revision=2016-06-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vrrp-r13?module=alu-conf-vrrp-r13&revision=2015-10-14</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vsm-r13?module=alu-conf-vsm-r13&revision=2015-09-16</capability>
<capability>urn:alcatel-lucent.com:sros:ns:yang:types?module=alu-types&revision=2015-01-19</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:conf?module=nokia-conf&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:sros-yang-extensions?module=nokia-sros-yang-extensions&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:types-filter?module=nokia-types-filter&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:types-qos?module=nokia-types-qos&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:types-services?module=nokia-types-services&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:types-sros?module=nokia-types-sros&revision=2016-01-01</capability>
<capability>urn:nokia.com:sros:ns:yang:sr:major-release-14</capability>
</capabilities>
<session-id>52</session-id>
</hello>
SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:message-id="1">
<nc:get-config>
<nc:source>
<nc:running/> </nc:source>
</nc:get-config>
</nc:rpc>
RECV: <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply urn:ietf:params:xml:ns:netconf:base:1.0:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>rpc</error-type>
<error-tag>missing-attribute</error-tag>
<error-severity>error</error-severity>
<error-info>
<bad-element>message-id</bad-element>
<bad-element>rpc</bad-element>
</error-info>
<error-message>
Check that message-id attribute is present and less than 4096 characters
</error-message>
</rpc-error>
</rpc-reply>
[Fatal Error] :2:20: Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character.
[Fatal Error] :2:20: Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character.
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 20; Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.tailf.jnc.YangXMLParser.parse(YangXMLParser.java:50)
at com.tailf.jnc.XMLParser.parse(XMLParser.java:154)
at com.tailf.jnc.NetconfSession.recv_rpc_reply(NetconfSession.java:1495)
at com.tailf.jnc.NetconfSession.recv_rpc_reply_data(NetconfSession.java:1472)
at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:443)
at client.Client.main(Client.java:51)
Exception in thread "main" Parse error: parse error: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 20; Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character.
at com.tailf.jnc.YangXMLParser.parse(YangXMLParser.java:54)
at com.tailf.jnc.XMLParser.parse(XMLParser.java:154)
at com.tailf.jnc.NetconfSession.recv_rpc_reply(NetconfSession.java:1495)
at com.tailf.jnc.NetconfSession.recv_rpc_reply_data(NetconfSession.java:1472)
at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:443)
at client.Client.main(Client.java:51)
You actually seem to have two problems, neither of which appear to be your fault. The get-config request from JNC seems to be malformed: message-id
attribute should be in the default namespace, not in NETCONF message namespace.
SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:message-id="1">
<nc:get-config>
<nc:source>
<nc:running/> </nc:source>
</nc:get-config>
</nc:rpc>
Should actually be:
SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<nc:get-config>
<nc:source>
<nc:running/> </nc:source>
</nc:get-config>
</nc:rpc>
The second problem is your server, which appears to be unable to handle this malformed request - and is responding with a malformed message (it is not even an XML message):
RECV: <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply urn:ietf:params:xml:ns:netconf:base:1.0:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>rpc</error-type>
<error-tag>missing-attribute</error-tag>
<error-severity>error</error-severity>
<error-info>
<bad-element>message-id</bad-element>
<bad-element>rpc</bad-element>
</error-info>
<error-message>
Check that message-id attribute is present and less than 4096 characters
</error-message>
</rpc-error>
</rpc-reply>
It should be responding with:
RECV: <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply nc:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>rpc</error-type>
<error-tag>missing-attribute</error-tag>
<error-severity>error</error-severity>
<error-info>
<bad-element>message-id</bad-element>
<bad-element>rpc</bad-element>
</error-info>
<error-message>
Check that message-id attribute is present and less than 4096 characters
</error-message>
</rpc-error>
</rpc-reply>
since it is supposed to return all attributes verbatim. Otherwise, this would be standard behavior when a message without a message-id
attribute is sent to a server.
Relevant RFC4741 text below (the same applies to RFC6241, NETCONF 1.1).
The <rpc> element has a mandatory attribute "message-id", which is an arbitrary string chosen by the sender of the RPC that will commonly encode a monotonically increasing integer. The receiver of the RPC does not decode or interpret this string but simply saves it to be used as a "message-id" attribute in any resulting <rpc-reply> message. For example:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <some-method> <!-- method parameters here... --> </some-method> </rpc>
If additional attributes are present in an <rpc> element, a NETCONF peer MUST return them unmodified in the <rpc-reply> element.
An error is returned if an <rpc> element is received without a message-id attribute. Note that only in this case is it acceptable for the NETCONF peer to omit the message-id attribute in the <rpc-reply> element.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get-config> <source> <running/> </source> </get-config> </rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-attribute>message-id</bad-attribute> <bad-element>rpc</bad-element> </error-info> </rpc-error> </rpc-reply>
So I believe you should be reporting two issues to both the maker of the device and to creators of JNC.
The reason it is working with the MG-SOFT client is that it sends a proper message-id
attribute, so your case never happens.