Lyo OSLC read raw xml rdf response from DOORS
I am using the following sample code to retrieve requirements data from DOORS by URL, which is derived from the eclipse lyo code examples, I can see the requirement data parsed into the "requirement" object, but I need to get the raw response (XML RDF) instead
I could not find a method or a field in the "ClientResponse" that returns this raw response.
ClientResponse response = client.getResource(url, OslcMediaType.APPLICATION_RDF_XML);
System.setProperty(AbstractOslcRdfXmlProvider.OSLC4J_STRICT_DATATYPES, "false");
Requirement requirement = new Requirement();
requirement = response.getEntity(Requirement.class);
Accepted answer
Ahmed,
The way Gabriel suggests is the most accurate one. The reason is that RDF/XML is not XML but first and foremost, RDF. Also, this is the only "exceptional" entity type can be read for all cases: https://wink.apache.org/documentation/1.0/api/org/apache/wink/client/ClientResponse.html#getEntity(org.apache.wink.client.EntityType) (I assume you are using the old Lyo Client).
Cheers,
Andrew
(Eclipse Lyo project lead)
Comments
Gabriel Ruelas
Jul 10 '18, 9:52 a.m.Hi,
InputStream is = getResponse.getEntity(InputStream.class);
Best Regards.