Я выполняю следующее:
HttpGet getMethod = new HttpGet(url);
getMethod.addHeader("Accept","application/x-oslc-cm-change-request+json");
HttpResponse httpResponse = httpClient.execute(getMethod);
, где URL-адрес указывает на файл XML, а именно:
<oslc_cm:Collection oslc_cm:totalCount="1">
<rtc_cm:Project rdf:resource="https://private"/>
</oslc_cm:Collection>
Далее я выполняю
InputStream is = httpResponse.getEntity().getContent();
String json = convertStreamToString(is);
JSON jsonObject = JSONSerializer.toJSON(json);
В последней строке я получаю исключение, JSONException: недопустимая строка JSON.
Есть что-то, чего я не делаю, или что-то пропустил?
Переменная json содержитhttp ответ:
<!DOCTYPE html>
<!--
a comment
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<title></title>
<link type="text/css" rel="stylesheet" href="/jazz/web/_style/?inclu
VelSxGN_en_US&_proxyURL=%2Fjazz">
<link rel="shortcut icon" href="/jazz/web/net.jazz.ajax/jazz.ico">
<style type="text/css">
#net-jazz-ajax-NoScriptMessage {
width: 100%;
color: #D0D0D0;
font-size: 2em;
text-align: center;
position: absolute;
top: 1%;
z-index: 999;
}
</style>
</head>
<body class="tundra">
<noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is disabled or not available in your Browser</div></noscript>
<div id="net-jazz-ajax-InitialLoadMessage">Loading...</div>
<div id="net-jazz-ajax-WorkbenchRoot"></div>
<script type="text/javascript">
djConfig = {
isDebug: false,
usePlainJson: true,
baseUrl: "/jazz/web/dojo/",
locale: "en-us",
localizationComplete: true
};
/*null*/
net = {jazz: {ajax: {}}};
net.jazz.ajax._contextRoot = "/jazz";
net.jazz.ajax._webuiPrefix = "/web/";
</script>
<script type="text/javascript" src="/jazz/web/_js/?include=Z~&eten_US"></script>
<script type="text/javascript">
/* <![CDATA[ */
dojo.getObject('jazz.core.loader', true)._loaded=['Z'];
net.jazz.ajax._rootServices = 'https://private';
net.jazz.ajax._storageService = 'https://private';
net.jazz.ajax._queryService = 'https://private';
net.jazz.ajax._infoCenterRoot = 'https://private';
net.jazz.ajax._oauthRealmName = 'Jazz';
net.jazz.ajax._viewletServiceRoot = 'https://private';
net.jazz.ajax._viewletWebUIRoot = 'https://private';
net.jazz.ajax._hasLocalRepository = true;
net.jazz.ajax._proxyLegacyMode = false;
net.jazz.ajax._oauthDomains = ['https://private']
net.jazz.ajax._friendDomains = ['https://private']
/* ]]> */
</script>
<script type="text/javascript">
/* <![CDATA[ */
dojo.addOnLoad( function() {
net.jazz.ajax.ui.PlatformUI.createAndRunWorkbencweb.app.authrequired");
});
/* ]]> */
</script>
</body>
</html
Спасибо