private XMLStreamWriter startServiceDocument ( ByteArrayOutputStream outputStream ) throws XMLStreamException , ODataRenderException { XMLStreamWriter writer = XMLWriterUtil . startDocument ( outputStream , null , SERVICE , ODATA_SERVICE_NS ) ; writer . writeNamespace ( ATOM , ATOM_NS ) ; writer . writeNamespace ( METADATA , ODATA_METADATA_NS ) ; writer . writeNamespace ( SERVICE_BASE , oDataUri . serviceRoot ( ) ) ; writer . writeNamespace ( ODATA_CONTEXT , getContextURL ( oDataUri , entityDataModel ) ) ; // WorkSpace element is only child of service document according to specifications. writer . writeStartElement ( ODATA_SERVICE_NS , WORKSPACE ) ; writeTitle ( writer , getEntityContainer ( ) . getName ( ) ) ; return writer ; }
Starts service document with correct attributes and also writes workspace title elements .