OLINGO-977: Adding the XML declaration to the response of Complex Collection

This commit is contained in:
Ramesh Reddy 2016-07-27 08:57:13 -05:00
parent 68d2e23ad4
commit aa8f2cfc2f
2 changed files with 3 additions and 2 deletions

View File

@ -1081,7 +1081,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
CircleStreamBuffer buffer = new CircleStreamBuffer();
outputStream = buffer.getOutputStream();
XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream, DEFAULT_CHARSET);
writer.writeStartDocument(DEFAULT_CHARSET, "1.0");
writer.writeStartElement(METADATA, Constants.VALUE, NS_METADATA);
writer.writeNamespace(METADATA, NS_METADATA);
writer.writeNamespace(DATA, NS_DATA);

View File

@ -2175,7 +2175,8 @@ public class ODataXmlSerializerTest {
.entitySet(edmEntitySet).keyPath("32767").navOrPropertyPath(edmProperty.getName())
.build())
.build()).getContent());
String expected = "<m:value xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
String expected = "<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<m:value xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
" xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\" "
+ "m:type=\"#Collection(olingo.odata.test1.CTTwoPrim)\"\n" +
" m:context=\"$metadata#ESMixPrimCollComp(32767)/CollPropertyComp\"\n" +