BUG-2878: Add the XML declaration to every outgoing NETCONF message. 19/16919/1
authorGwenael Lambrouin <gwenael.lambrouin@b-com.com>
Fri, 20 Mar 2015 14:02:31 +0000 (15:02 +0100)
committerGwenael Lambrouin <gwenael.lambrouin@b-com.com>
Fri, 20 Mar 2015 14:04:36 +0000 (15:04 +0100)
commitec7ec6f9ccf48b2c2bc4d14b19a279410108309f
tree96bbb83783e0bebb15ef0e34601fd2450210c169
parent9b2d6abcc63a9253571ed474419039b1fe1914c8
BUG-2878: Add the XML declaration to every outgoing NETCONF message.

Cisco routers expect that NETCONF messages are prefixed by the XML declaration
<?xml version="1.0" encoding="UTF-8"?>. Else, they close the NETCONF/SSH
connection and log an error such as "NETCONF-ERROR: parse error before hello seen".

This patch adds the XML declaration to every outgoing NETCONF message so that
Cisco routers accept NETCONF messages coming from the OpenDaylight controller.

This is a workaround for the sake of interoperability: according to RFC 6241,
the XML declaration is optional so Cisco routers should accept NETCONF messages
without XML declaration. See RFC 6241 section 3 "XML Considerations":

   A NETCONF message MAY begin with an XML declaration (see Section 2.8
   of [W3C.REC-xml-20001006]).

Change-Id: I04a8b61a8fcef6738e8a4552f0560aa319add014
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@b-com.com>
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ThreadLocalTransformers.java