java - <data> element inside 404 response -
i'm trying integrate restful web service , i've been told 404 errors contain error message wrapped inside xml tag.
sample response:
http/1.1 404 not found server: apache-coyote/1.1 content-length: 170 date: tue, 15 sep 2015 13:57:40 gmt <data contenttype="null" contentlength="170"> <![cdata[this error message.]]> </data>
does know if standard practice? if so, how parse it? successful responses have expected type defined in xsd use jaxb. our client code in java. admin of web service says no xsd required new 404.
i'm thinking either xsd describes element required or element that's standard , there's easy way interpret it.
i've been given snippet of code web service apparently used generate above response.
response.reset(); response.setstatus(errorcode); try { final printwriter writer = response.getwriter(); writer.print(exception.getmessage()); writer.close(); response.flushbuffer(); } catch (ioexception e) { logger.error( e.getmessage(), e); }
should asking xsd? or there easy way interpret response? (besides parsing out message).
any info great.
figured out.
for sample admin gave pasting http headers raw response clicking "xml" button in soapui adding stuff , pasted underneath http headers. element isn't part of response @ all.
Comments
Post a Comment