OS : Intel
TS 7.2
LSCS 7.2 - api v1
Dear All,
I am writing a stand-alone java application to prototype some code for a component. The code connects to LiveSiteCSAuth but fails to retrieve a document. As you can see from the results is looks lI;m getting a Jason object and this does not match the lscsdocument. Any ideas ?
The code is :
package com.lbg;
import java.util.Properties;
import com.interwoven.wcm.lscs.Client;
import com.interwoven.wcm.lscs.Document;
import com.interwoven.wcm.lscs.Factory;
import com.interwoven.wcm.lscs.LSCSException;
import com.interwoven.wcm.lscs.impl.Context;
public class TestLCSConnection {
public static void main(String[] args) throws LSCSException {
Properties properties = new Properties();
properties.setProperty("lscs.transport","http");
properties.setProperty("lscs.host","asbcms72");
properties.setProperty("lscs.port","8080");
properties.setProperty("lscs.context.path","lscs");
properties.setProperty("lscs.version","v1");
Factory factory = new Factory();
Client client = factory.getClient(properties);
client.setProject("//asbcms72/default/main/component-guide");
Document doc = client.getDocumentById("3f0cf3e96a86c24a355e1bd5bf3dd3e9");
System.out.println(doc.toString());
}
}
Results :
Exception in thread "main" com.interwoven.wcm.lscs.LSCSException: org.json.JSONException: A JSONObject text must begin with '{' at character 1 of
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.interwoven.com/schema/iwrr iwrr.xsd"
total="1" included="1" start="0" status="200">
<metadata>
at com.interwoven.wcm.lscs.impl.JSONExtractionUtils.extractDocumentFacets(JSONExtractionUtils.java:146)
at com.interwoven.wcm.lscs.impl.ClientImpl.getDocumentById(ClientImpl.java:175)
at com.lbg.TestLCSConnection.main(TestLCSConnection.java:37)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at character 1 of
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.interwoven.com/schema/iwrr iwrr.xsd"
total="1" included="1" start="0" status="200">
<metadata>
at org.json.JSONTokener.syntaxError(JSONTokener.java:529)
at org.json.JSONObject.(JSONObject.java:202)
at org.json.JSONObject.(JSONObject.java:368)
at com.interwoven.wcm.lscs.impl.JSONExtractionUtils.extractDocumentFacets(JSONExtractionUtils.java:98)
... 2 more