rest 1 « restful « Java Enterprise Q&A





1. REST in Java    stackoverflow.com

I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made ...

2. JAX-RS Frameworks    stackoverflow.com

I've been doing some work with the JAX-RS reference implementation (Jersey). I know of at least two other frameworks (Restlet & Apache CXF). My question is: Has anyone did some comparison between those ...

3. How do you compare Websphere Commerce with the rest of the ecommerce tools available in the market?    stackoverflow.com

All those familiar with websphere commerce will know that it is feature rich. It supports B2B, B2C and extended sites(which ATG doesn't) and some other features. But it is complicated, and ...

4. Is it feasible to create a REST client with Flex?    stackoverflow.com

I'm starting a project using a Restful architecture implemented in Java (using the new JAX-RS standard) We are planning to develop the GUI with a Flex application. I have already found some ...

5. Testing REST webservices    stackoverflow.com

My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has ...

6. Rest clients for Java?    stackoverflow.com

With JSR 311 and it's implementations we have a powerful standard for exposing Java objects via Rest. However on the client side there seems to be something missing that is comparable ...

7. Any easy REST tutorials for Java?    stackoverflow.com

OK - Im getting really piss3d off here!!! Every tutorial or explanation of REST just goes too complicated too quickly - the learning curve rises so fast after the initial explanation ...

8. Reasonable to hold an HttpUrlConnection open indefinitely to a remote REST endpoint?    stackoverflow.com

I am looking to optimize a process that runs continually and makes frequent calls (> 1 per second on average) to an external API via a simple REST style HTTP post. ...

9. How to implement REST in a web-aplication?    stackoverflow.com

i want to know how i could be implement REST in my web aplication. I want to create a web aplication based in this service, but i don't know how to ...





10. ATOM for messaging service for "enterprise"    stackoverflow.com

I went to Jim Webber presentation and in the middle of his apresentation he stated that ATOM is a good replace for JMS in many cases. Since JMS is ...

11. JAX-RS is perfect for implementing REST. What do you use to call REST services in Java?    stackoverflow.com

Ideally, I am looking for something like JAX-RS (using annotations to describe the services I want to call), but allowing to call REST services implemented using other technologies (not JAX-RS). Any ...

12. What is best book for learning rest?    stackoverflow.com

What is best/good book to learn REST ? Same time looking good REST framework in java or groovy.

13. How do I Invoke 3 REST endpoints in parallel?    stackoverflow.com

I have to invoke REST endpoints A, B & C in parallel and combine the resulting JSON from each into one JSON. All REST endpoints reside on different servers. My initial design ...

14. Send java object to a rest WebService    stackoverflow.com

I'm searching a nice way to send a java object to my rest web service.
It's possible or not ?
For sample I wan't to send an "User" Object to my ...

15. URL Mapping a Rest Webservice    stackoverflow.com

I have to map a REST Webservice URL like "http://server:8080/application/service/customer/v1" to createCustomer method in CreateCustomerBean class.. I have done the following mappings..

  *Web.xml*
    <servlet-mapping>
    <servlet-name>RestiveServlet</servlet-name>
 ...

16. any good books on scalable web applications (Java/Ajax/REST)?    stackoverflow.com

Are there any good books on the subject worth reading and still up-to-date with current technologies? I'm mostly interested in back-end architecture and things I should consider choosing clustering and database solution ...





17. Web service frameworks for Java 1.4?    stackoverflow.com

We want to implement web services on our Weblogic 8.1 Java 1.4 application. We want to create new server services and call services in other apps. And we need ...

18. Java interface static method workaround?    stackoverflow.com

We have a given REST interface:

POST /calculation
<data>abc</data>
This calculation can be implemented by different logical "calculators" depending on the server config. We are now designing the Java interface that each calculator ...

19. Using HTTPS with REST in Java    stackoverflow.com

I have a REST server made in Grizzly that uses HTTPS and works wonderfully with Firefox. Here's the code:


//Build a new Servlet Adapter.
ServletAdapter adapter=new ServletAdapter();
adapter.addInitParameter(
 "com.sun.jersey.config.property.packages",
 "My.services");
adapter.addInitParameter(
 ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
 SecurityFilter.class.getName());
adapter.setContextPath("/");
adapter.setServletInstance(new ServletContainer());

//Configure ...

20. How to model parent-child entities via REST and JAX-RS    stackoverflow.com

I am working on a REST based API, and having some trouble figuring out what the canonical way is to represent parent / child relationships. (I am writing beans in ...

21. Method to handle "killed" Java jobs?    stackoverflow.com

Our server web app will handle jobs that are requested by REST API requests. Ideally if the server dies during a job (ie: plug pulled), the job should resume or restart at ...

22. Need to implement custom Fitnesse responders    stackoverflow.com

I believe that I am in need of implementing custom Fitnesse responders for a client but have not found much success in my research/attempts to make this work. The idea is ...

23. Web service for retrieving chunks of data    stackoverflow.com

I'm planning to develop a webservice, and I like to try the RESTful architecture. The issue is that I don't know if the service is adequate for it, or it is ...

24. Is REST a good choice for GUI web applications?    stackoverflow.com

GUI based web applications could be build upon a GUI component, stateful framework like Wicket or they could build in a RESTful, stateless way with GUI status only on the client. ...

25. Alternative to web services in Java    stackoverflow.com

I have this external module of my system and I thought to integrate it with web services. So I wrote the server using annotations (so far so good) and then I ...

26. REST service with binary data    stackoverflow.com

I want to create Restful service which can accept binary data. I've implemented javax.xml.ws.Provider interface, but i can't get content of request. If I use javax.xml.ws.Dispatch then its send only XML data, ...

27. Should I use java-based rewrites instead of mod_rewrite?    stackoverflow.com

I want to implement some attractive /path/to/my/app URLs for a java application. There is already an apache instance in front of the app server, with mod_rewrite installed. Do I win anything ...

28. Tapestry + REST    stackoverflow.com

I want to add REST to my tapestry project, and so need to know how to implement it. What is the better way ? thx. [Edit, copied from answer:] I have to add GET, ...

29. MediaType of REST    stackoverflow.com

I am beginner in REST web services. I wrote a program of REST to display the HTML or XML. The @Path annotation's value is @Path("{typeDocument}"). There are two methods for GET :

@GET
@Produces(MediaType.TEXT_XML)
public ...

30. Best practices in terms of replacing a web service?    stackoverflow.com

So we have a busy legacy web service that needs to be replaced by a new one. The legacy web service was deployed using a WAR file on an apache tomcat ...

31. Sending protocol buffers via REST    stackoverflow.com

I am trying to implement protocol buffers for client/server using REST. I am still a bit confused if I need to send protocol buffers request in byte format? I mean, in my ...

32. Is it possible to use JAX-RS as a web framework?    stackoverflow.com

I've been looking into JAX-RS lately because I really like the Java platform and a RESTful style of web development. I've read a lot about using JAX-RS for creating RESTful Web ...

33. Is REST supported by default in JavaScript and Java or do I need to install new software?    stackoverflow.com

Do I require to install new software to use REST services with JavaScript and Java?

34. image-bytes to Rest    stackoverflow.com

I have stored image in database and I want it expose via rest. What is the best way?

@Path("/image/{imageId}.jpeg")
@Stateless
@Produces({"image/jpeg"})
public class ImageSource{
 @PersistenceContext
 EntityManager em;

 @GET
 public /* what */ getImage(@PathParam("imageId") Long imageId) ...

35. Advice on http-method overloading in REST    stackoverflow.com

I've used a regular expression in @Path to achieve overloading and at first I thought it was really neat, but overloading methods is usually not good practice. Does the same apply ...

36. Rest - how get IP address of caller    stackoverflow.com

I am writing a Java Rest Web Service and need the caller's IP Address. It thought I saw this in the cookie once, but know don't see it. Is ...

37. Java Rest framewok    stackoverflow.com

Which is a good java REST framework? I would like it to be deployed with Tomcat 6.

38. What is vSphere and vCloud?    stackoverflow.com

  1. Can any one help me in understanding vSphere n vCloud director? And difference in both?
  2. How to use vCloud's REST URI's in own Java application once it has been installed?
  3. Any Java example ...

39. Java: Split last digit from the rest of the INT    stackoverflow.com

I have the next code, which gets a number, I need to split that number in to parts, firstPart should be the whole number without the last digit, and the secondPart ...

40. Does the List subList() method prevent garbage collection of the rest of the list?    stackoverflow.com

I'm curious to find out how the latest JVMs would handle garbage collecting memory reserved by the following method.

public List<Player> getHallOfFame() {
  ArrayList<Player> listToSort = new ArrayList<Player>(map.values());
  Collections.sort(listToSort, comparator);

 ...

41. Handling attachments with REST WS    stackoverflow.com

Friends, Is it possible to send attachments (binary content) to a RESTful WS, as we do to SOAP based WS ? How do we handle it in the REST WS ? I ...

42. apache wink jettison    stackoverflow.com

Using Jettison provider.

 public Set getClasses() {
  Set s = new HashSet();
  s.add(DatabaseResource.class);
  return s;
  }
  public Set<Object> getSingletons() {
  Set s = new HashSet();
 ...

43. REST - Why generated excel file is not actually created when tried as web application?    stackoverflow.com

I created simple REST web app that would create Excel file and put into current directory. But somehow the generated excel is not in the directory. Actually it is not even being ...

44. InputStream read(byte[] b, int off, int len) - Drop the rest of the file?    stackoverflow.com

This is an extension of a question I asked on here this morning so please don't disregard if you think you've seen this code before :D

for (String name : filenames) {
FileInputStream ...

45. How to Create A REST webservice?    stackoverflow.com

Hi
I like to create a API webservice like Facebook, in Java? and how can i use PHP for access it???

46. socket -V- rest performance    stackoverflow.com

I have done some searching but haven't come up with anything on this topic. I was wondering if anyone has ever compared (to some degree) the performance difference between an RPC ...

47. Creating playlist with JAVA language o Web Services rest    stackoverflow.com

Dear, how can I create a playlist in java invoking externale services adapted to the creation of playlist?

48. IBM Websphere Integration Developer - Using JAX-RS    stackoverflow.com

I know this isn't the best place to put this question but here it goes... I'm using IBM Websphere Integration Developer... I used JAX-WS runtime to create webservices from a Java test class, ...

49. Java Project Ideas for two Projects    stackoverflow.com

Hi I have two large programming assignments this semester and I would like ideas for them since I am having a little trouble coming up with good ideas. Both must be ...

50. java REST frameworks : how do I pick one?    stackoverflow.com

We're evaluating which of the REST frameworks in the Java world to use 1) Jboss RESTEASY
2) Apache CXF
3) Java/Oracle JAX-RS
4) ??
What is important to us(not necessarily in this order)
1) Supports Declarative ...

51. JAX-RS Encoding    stackoverflow.com

I'm using JAX-RS to create a web service that returns results in JSON format. Everything is OK, except the encoding... For example, I get: ..., parameter:"Dep\u00f3sitos" ,... Instead of: ..., parameter:"DepĆ³sitos" ,... I've tried using: @Produces("application/json; charset=UTF-8") But still ...

52. What is a good technology stack for a java web based application with REST support?    stackoverflow.com

Evening all :) I'm looking to create a Java web application. I envisage that it will use Spring web MVC and JSPs, however I would like to expose certain functionality as REST ...

53. REST Authentication    stackoverflow.com

HI All, I am looking for a Java based REST server which support following authentication mechanism. Also please let me know the best resources for the REST based authentication 1) Token 2) Certificate 3) Kerberos 4) ...

54. REST endpoint metadata in java    stackoverflow.com

All I am looking for some method to show metadata info about RESTful webservice, e.g. operations, parameters and so on. Do u know any ?

55. Call REST webservice from Java 1.4    stackoverflow.com

I want to call a REST webservice using a POST-method from a Java 1.4 environment (Weblogic 8.1). The webservice accepts a Order-object. Currently I'm doing something like:

String xml = new XStream(new ...

56. Serialization of key/value pairs in Jackson?    stackoverflow.com

I have a class

class Foo {
  String key;
  String value;
}
and want to serialize this into "<content of key>":"<content of value>" How can I achieve this (and how to deserialize "myKey":"myVal" ...

57. The current event is not START_ELEMENT but 2    stackoverflow.com

We are converting existing JAX-WS implementations to restful web-services. What we have done so far:

  1. Created a Weblogic implementation of restful webservice
  2. modified client to point to the new restful service endpoint
Now when ...

58. Upload data method in REST web service    stackoverflow.com

Do anyone know how can I write POST method in RESTful web service to upload data using java ? I found that smartupload and commons.upload are just for web page. thanks

59. How can I read the rest of a file after the first 64 bytes?    stackoverflow.com

I must use a file for work. First 64 byte must be a header. So I must read first 64 bytes and then read to end of file. How can I ...

60. download data method in REST web service in web application    stackoverflow.com

In web application,how to write download data/files method in REST web service using java? It can write with InputStream ?Could anyone give sample code? thanks

61. how to copy zip and other files in REST web service using java    stackoverflow.com


Do anyone know how to copy data in zip file, jar file , binary file and others in REST web service using java? I write a web service method ...

62. J2EE design pattern - How to make an application independent of backend service    stackoverflow.com

I am trying to develop some RESTful web services which have to access some backend system for data. These backend sources can be any one of the folowing :

  1. Database through JDBC
  2. ERP, ...

63. Changing content type in jax-rs REST service    stackoverflow.com

Forgive me, but I may not be familiar with all the lingo necessary to ask this question properly. I'm working on a fairly simple REST web service in Java using the ...

64. how to download different type of files in rest web service using java    stackoverflow.com

I want to download files which i wrote @POST method in rest web service using java. I used with FileIOStream, but i find that i can download images and zip file types,but ...

65. Oracle weblogic access control 11g    stackoverflow.com

Just I have installed Oracle Weblogic Server and configured RESTFul Service. Developer can able use in office network but when I placed it in proxy server then It is supporting. As per ...

66. AMF as a REST format, using BlazeDS and AS3's URLLoader    stackoverflow.com

I have a ColdFusion server with an HTTP API that's currently returning either JSON or XML formatted responses. Internally, all of these responses are represented using the ColdFusion 'struct' type, and ...

67. how to get source file in HttpRequest for uploading file    stackoverflow.com

I have a problem with upload file in REST web service using java. I don't know how to get the source file. The curl command is like that curl --upload-file ...

68. Does axis 2 support REST?    stackoverflow.com

I am trying to provide REST support in our platform. We already have integrated Axis 2 in our framework. And Axis 2 is supporting the REST. So I was thinking of ...

69. Create JAX-RS provider to create a Java Image from InputStream    stackoverflow.com

I'm trying to create an image/jpeg jax-rs provider class that creates an Image for my post rest based web service. I'm unable to formulate the request in order to test the ...

70. hide or remove the path in REST web service    stackoverflow.com

how to hide or remove the project path in REST web service using java? Now , I run my web service using curl command curl -X PUT http://localhost:8080/project/resources/user/bucket But in CDMI ...

71. Java: deploying one method before continuing with the rest    stackoverflow.com

Hey guys, I'm kinda new to Java. Lets say I have two methods, spinner() and loadEverything(). I want to execute spinner() first and have it run while loadEverything(), which is kinda heavy, ...

72. REST Web service. Making service system not accessible    stackoverflow.com

I have REST Web service written in Java. Now I want to disable Web service such as services (GET methods) won't be accessible over URI or by application. That means I ...

73. How to use REST while using Java?    stackoverflow.com

I am using Spring MVC and want to develop a website that uses REST API provided by LinkedIn. I am very new to REST and have no Idea of how to ...

74. Multiple content type support using JAX-RS    stackoverflow.com

The goal is to create a rest-full web service using JAX-RS that will selectively return the result either in json or xml format, depending on the user request. For example, if ...

75. When to use pathParams or QueryParams    stackoverflow.com

Is there a rule of thumb as to when one should use path parameters for a URL versus when you should use query parameters? Say I've got a table Invoice with the ...

76. Temporary, in memory, files in Java    stackoverflow.com

We have a content management system to allow our users to store files uploaded through a REST web service. Before storing these files in the repository, their contents are encrypted. When ...

77. After converting List to Set, enhanced for loop throws a ClassCastException    stackoverflow.com

I have a problem after I convert List<MyCustomObject> to a HashSet<MyCustomObject>. When I try to iterate through each element using an enhanced for I get a ClassCastException stating that "java.util.HashMap cannot ...

78. Is there a way to programmatically add register methods to a REST web service without using annotations?    stackoverflow.com

Is there any REST framework that supports programmatically addition of methods? I don't want to use annotations. I want to do something like this:

RestServer server = new RestServer("http://localhost:5678");
server.registerOperation("/ping","com.mypackage.service.Ping","methodName","GET");
server.registerOperation("/add/{number}/{number}","com.mypackage.service.Math","sum","POST");
server.start();

79. Async REST calls with JAX-RS    stackoverflow.com

I need to create a RESTful service which should support async calls in follwing way. When user calls some method he got the http '202' code and url to poll where ...

80. rest implementation without annotations    stackoverflow.com

I am trying to learn REST web services. But it seems to use annotations every where. Is there any implementation of Rest framework without using annotations.I have no idea about annotations. Thanks ...

81. RMI vs REST Service    stackoverflow.com

We are developing a service for our portal / web client developed using JSF . My advice was to expose the service as REST but another team member said to go ...

82. Is it a REST web service?    stackoverflow.com

I am working on a legacy application which have a .war with following structure (and I want to add my servlet in this war)

     myApp.war
 ...

83. REST support within a java templating engine such as StringTemplate, FreeMarker, Velocity or Tiles?    stackoverflow.com

I'd like to compare some templating engines that supports creating RESTful URLS for templating header/body/footer pages in a java application. I don't want my pages to have a jsp, .st ...

84. java rest client: jax-rs & automatic type mapping    stackoverflow.com

Here is what I am trying to do: Create an interface (as an example):

@Path( "/" )
public interface Bubbles {

   @Get
   @Path( "blowBubble" )
   @Produces( "text/plain" )
 ...

85. CMIS vs REST. Which client would be easier to implement from scratch?    stackoverflow.com

Im working on a Java project that needs to upload files using either REST or CMIS (both services are available). I'm completely new to these APIs and would like to ask ...

86. Is there a light weight java web service framework or lib?    stackoverflow.com

I just want to find a light weight framework or lib based on which rest-style service can be registered. I will use tomcat or jetty as the web server. Is there ...

87. What is the best practice to pass a Complex class instance to a REST Web Service?    stackoverflow.com

I am currently writing a java REST Web Service using Netbeans and Glassfish. The WebService is a CRUD web service on an SQL database. Netbeans did most of the work for me by ...

88. Java REST ful client code is problem    stackoverflow.com

I am trying to create the REST-ful web service in java. This REST-ful web service contains both Hibernate configuration and Rest-ful configuration. Actually the java web service is working perfect. but when i ...

89. REST service with JAX-RS and OData?    stackoverflow.com

I have been playing with some REST web services which use JAX-RS annotations. I am now looking at using OData for our query type services. However, I haven't see any OData examples that ...

90. How are REST URLs typically defined?    stackoverflow.com

I know that one of the main principles of REST is that you create a unique URL to every resource. My question is, how are these URLs typically defined?

91. Does odata4j support exposing existing services as OData endpoints?    stackoverflow.com

Does odata4j support exposing existing REST-based services as OData endpoints or is it only to create new RESTful services that expose Odata endpoints? The examples given in the sdk for OData ...

92. How do I edit a properties file without trashing the rest of it    stackoverflow.com

Example.properties

user=somePerson
env=linux
file=mpg
properties.java class
propertiestTest.java
   {
     Properties props = new Properties();
     props.setProperty("user", "GodIsUser");
     final File propsFile = new File(someDir/Example.properties");

  ...

93. Using Clojure with an annotation-based REST Server    stackoverflow.com

I am considering writing a REST Server using Clojure. I have experience using RESTEasy with Java. It uses annotations to associate URLs, template parameters, and query parameters with Java classes, ...

94. How to send a photo to a rest service    stackoverflow.com

What is the best approach to be able to send a photo from the iPhone client to a rest service (jax-rs) and save it from there? This is my current server ...

95. Already have Java REST server, which Java web framework to use?    stackoverflow.com

I already have back-end Java server that exposes interface through a REST services, sending JSON objects. I need to choose Java web framework to create front end. The only requirement is ...

96. How to make this REST get method in Java?    stackoverflow.com

I have the following REST get Request that works successfully: enter image description here The result is a XML document that I then want to parse. I tried the same in ...

97. How to retrieve all project areas from a Java Team Server?    stackoverflow.com

I installed a local Java Team Server, version 3.0.1. I'm trying to use the REST web services to retrieve all the project areas. For that I first authenticated myself:

public HttpContext login() ...

98. Java REST Chunked Encoding    stackoverflow.com

I'm trying to read some information with a REST-Service that uses chunk-encoding.

String encodedURL = URLEncoder.encode(url, "UTF-8");
WebClient client = org.apache.cxf.jaxrs.client.WebClient.create(encodedURL).accept("text/html");
Response response = client.get();
The response contains a status, metadata and the entity. ...

99. Passing map object using ReST    stackoverflow.com

I am new to ReST. How can I pass a Map<K, V> object (Java) using ReST(RESTlet)?

100. REST ful java web service on heroku?    stackoverflow.com

how to write java REST Web service and Deploy it on heroku? Till now I just worked on simple java application on heroku, first time I am trying ...