Quantcast
Channel: Viewing Odata response in web browser - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Viewing Odata response in web browser

$
0
0

Hi All
I have used Odata4j to create Odata Service and deployed in tomcat. When i use Sesame Data Browser i can see a Table
(if i click on THREAD ) having header.My question what should be the url to see the same data in web-browser? I want to consume this in a service so want to know url.

If i type this in http://localhost:8888/OdataEx/example.svc browser i can see some XML

<?xml version="1.0" encoding="utf-8" ?> <service xmlns="http://www.w3.org/2007/app" xml:base="http://localhost:8888/OdataEx/example.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"><workspace><atom:title>Default</atom:title> <collection href="Threads"><atom:title>Threads</atom:title> </collection></workspace></service>


and Java code generating service is

public class ExampleProducerFactory implements ODataProducerFactory {  public ODataProducer create(Properties properties) {    InMemoryProducer producer = new InMemoryProducer("example");    // expose this jvm's thread information (Thread instances) as an entity-set called "Threads"    producer.register(Thread.class, Long.class, "Threads", new Func<Iterable<Thread>>() {      public Iterable<Thread> apply() {        ThreadGroup tg = Thread.currentThread().getThreadGroup();        while (tg.getParent() != null)          tg = tg.getParent();        Thread[] threads = new Thread[50];        int count = tg.enumerate(threads, true);        return Enumerable.create(threads).take(count);      }    }, Funcs.method(Thread.class, Long.class, "getId"));    return producer;  }}

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>