Retrieving data with JAVA client API

148 views
Skip to first unread message

Naveen kumar

unread,
May 7, 2014, 9:47:22 AM5/7/14
to version...@googlegroups.com
When I try to retrieve the data from version one with Java client getting following error

Using Integrated Windows Authentication.

[Fatal Error] :80:3: The element type "table" must be terminated by the matching end-tag "</table>".
Exception in thread "main" com.versionone.apiclient.APIException: SAX Error : Data/Member/1076?sel=
at com.versionone.apiclient.XMLHandler.buildDocument(XMLHandler.java:39)
at com.versionone.apiclient.Services.retrieve(Services.java:52)
at com.ca.gen.reports.RetriveData.main(RetriveData.java:35)
Caused by: org.xml.sax.SAXParseException; lineNumber: 80; columnNumber: 3; The element type "table" must be terminated by the matching end-tag "</table>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at com.versionone.apiclient.XMLHandler.buildDocument(XMLHandler.java:32)
... 2 more

and here is the program 

V1APIConnector dataConnector = new V1APIConnector("https://www10.v1host.com/CA/rest-1.v1/");
V1APIConnector metaConnector = new V1APIConnector("https://www10.v1host.com/CA/meta.v1/");
IMetaModel metaModel = new MetaModel(metaConnector);
IServices services = new Services(metaModel, dataConnector);
Oid memberId = Oid.fromToken("Member:1076", metaModel);
Query query = new Query(memberId);
   QueryResult result = services.retrieve(query);
   Asset member = result.getAssets()[0];

   System.out.println(member.getOid().getToken());
   
   /***** OUTPUT *****
    Member:20
   ******************/

Thanks,
Naveen

ibuchanan

unread,
May 16, 2014, 5:02:25 PM5/16/14
to version...@googlegroups.com
Naveen,

There error is not from Windows Integrated Authentication, but from SAML SSO. This requires some explaining.

We tried to "retrofit" the Java and .NET SDK libraries with SAML SSO. While SAML SSO is good for web browser SSO, it was not possible to write good adapters without each customer providing a unique adapter. That meant each customer would have to hand-modify existing integrations and recompile. So we felt that was a technical dead-end.

To provide access to the API endpoints, we choose a different standard, OAuth 2.0. This is better suited to system-to-system communications. However, it is relatively new for VersionOne and we have only had time to OAuth-enable the SDK.NET. The Java libraries are not OAuth-enabled.

One option that will help you avoid rewriting would be the oauth2proxy:

Hope that helps.

Ian Buchanan
Product Manager for Platform and Integrations
Reply all
Reply to author
Forward
0 new messages