BUG-2878: Add the XML declaration to every outgoing NETCONF message.
authorGwenael Lambrouin <[email protected]>
Fri, 20 Mar 2015 14:02:31 +0000 (15:02 +0100)
committerGwenael Lambrouin <[email protected]>
Fri, 20 Mar 2015 14:04:36 +0000 (15:04 +0100)
commite58af1694941f8e6f1498e50a4c159a0fb29edfd
tree57b0d20ed5b22efc21f9259d15dc05562f54b869
parent15ae5df2c8394058d7ff1298125b35c444e324f4
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 <[email protected]>
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ThreadLocalTransformers.java