In short, yes. With StreamWriter, we basically have two different writer mechanisms now. By default, AbstractProvider uses StreamWriter to output the service document, while the FOM objects use the Writer and NamedWriter mechanism. Also, be aware that the prettyxml writer definitely is not perfect; I'd caution against using it extensively in a production environment because it can tend to insert more whitespace than is actually necessary and can interfere with things like digital signatures and encryption.

- James

Jim Ancona wrote:
James M Snell (JIRA) wrote:
Resolution: Fixed Fix Version/s: 0.4.0

Fix checked in. Give it a try.  In my tests, I was able to
successfully set both the prettyxml and json writers as the default

I'm replying here rather than in JIRA, because I'm not sure whether the
behavior I'm seeing now is a bug.

With James' fix, documents being served from my Adapters are now
formatted using PrettyXML, but I noticed that my service document was
still unformatted. I notice that AbstractProvider.getServiceDocument()
uses StreamWriterResponseContext to generate the service document. I
overrode that method to call setAutoIndent(true) on the ResponseContext
and got the desired behavior. Is that the best way to get a formatted
service document? Any suggestion on how to get a JSON service
version :-)?

Jim


Reply via email to