you can absolutely use Java to access the data. Many people already have in creating Java apps, web apps, Android Java apps, and Blackberry Java ME apps.

We created our Data Extraction API in such a way that it is _code free_! You don't need any code to get data using our REST requests. In fact, try it out and log in and create a REST url from our http://generator.webtrends.com and then paste the REST URL into your browser address bar and the data will simply return (after you authenticate of course).

But I can give you some helpful pointers for getting your Java app running with our data embedded in it.

The process is simple.

Short summary:

All you need is a java library for making an https connection.
Pass your webtrends account name along with your username in the authentication process with a backslash seperator.
Create your REST request in generator.webtrends.com and choose a format you prefer.
Add a parser library to your java code for the format you chose.

Step by step pointers:

1) For libraries, to make an Extraction request, all you need is any method of making an https request (there are lots of http helper libraries out there) with authentication. In order to make this as easy to embed in applications as possible, we use http authentication. Here is a link to apache commons libraries: http://commons.apache.org/

2) when you pass your username and password in the https request you need to follow this format:

Username should look like: webtrendsAccountName\userName (i.e. the username should have your webt account, backslash, username)

Password should look like: password (send your password as normal of course)

3) practice with a simple Webtrends REST request first. Create one in generator (http://generator.webtrends.com) from a basic report for "this month" and copy and paste the URL it generates for you into your test code.

4) once you send the https request Webtrends will respond with all the data. No extra code is needed of any kind. In fact, if you were to paste that REST request into your browser, the data would simply show in your browser window.

Do you want it in XML, JSON or HTML format?

Many developers find it easiest to recieve data in XML because there are so many XML parsers out there. See my link above to apache commons.

I suggest you use our XML format made friendly for developers and change your rest request to show format=xml2

That "xml2" is not a typo. We have two xml formats to use and xml2 is the easiest to automate parsing for.

5) get yourself a java parser for the format you chose in step 4. Apache commons has one for both XML and JSON. If you want to pursue JSON further (json is more compact, faster and efficient but not as easy to develop for) go to http://json.org/index.html and scroll down and you'll find a dozen or more json parsers for every platform. If you are using Java to develop for Android, I recommend "gson".

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 剑指offer(一):找出数组中重复的数字
  2. 函数作用域与闭包、回调使用场景与参数调
  3. 第24章 0118-vue常用指令介绍,学习心得、
  4. 搭建php环境以及运行原理-php与html混编
  5. python入门教程13-02 (python语法入门之库
  6. php函数讲解
  7. PHP常用运算符与流程控制
  8. PHP函数中那些容易忽略的细节
  9. Xshell和WinSCP的使用
  10. 二叉树