rest 2 « restful « Java Enterprise Q&A





1. Why printing '\0' will nullify the rest of the line in Java?    stackoverflow.com

I find out to my puzzlement that the following snippet:

void print() {
    System.out.print("!");
    System.out.print("!\0");
    System.out.flush(); // This line does not affect the ...

2. An interface in Java can have one and only one modifier which is public. Why are the rest not allowed?    stackoverflow.com

Possible Duplicate:
Protected in Interfaces
The following code snippet shows that an interface in Java can have only one modifier which is public. No other modifiers ...

3. How to generate Java classes from REST    stackoverflow.com

With SOAP WebSevices and WSDL it's very easy to generate a Java WebService client with wsimport. Is there a similar way to do this for Java REST clients? Thanks, Simon

4. Is there an OpenRasta like REST framework for Java?    stackoverflow.com

The circumstances force me to start writing a java based server and I am looking for a REST framework for Java. I really like the way OpenRasta works - a REST ...

5. Arraylist implementation    stackoverflow.com

I have a class Researcher, and an ArrayList named researcherList that contains a list of researchers.
I want to get all researchers information from the database and put it in the researcherlist ...

6. Testing web pages using Java    stackoverflow.com

I am looking for java tests that I can use in automation testing of web pages hosted locally. These are for RESTful web services. The situation is we have some web pages or ...

7. Multiple files upload using REST    stackoverflow.com

I have a input type=file tag in my html which allows user to select multiple files. The action for the form is a REST web service:

@POST
@Path("savefile")
@Produces ({MediaType.TEXT_PLAIN})
public String createObjects(
   ...

8. GET REST error 415    stackoverflow.com

I am getting the following error message when trying to execute a GET REST command: "returned a response status of 415 Unsupported Media Type" This is the code:

<code> whenGetPatternByGroupName() {
    ...

9. RESTClient error message    stackoverflow.com

I'm getting this error form RESTClient application when I'm returning a String with Turkish characters inside, but Turkish characters could be able to be encoded using UTF-8: "Response body conversion to string ...





10. JAX-RS with embedded server    stackoverflow.com

Clarification: this question was about GZIPping an JAX-WS-based REST service, but I've decided to change the topic to make it easier to find I'm implementing a REST service via JAX-WS Provider <Source>, ...

11. Create 50 element boolean array, set first 25 elements true, rest false    bytes.com

I guess you don't have a code for this. Follow this algorithm. 1)Take a boolean array of size 50 2)Loop through first 25 elements of the array and set the value ...

12. PUT and DELETE (REST web service load testing)    jmeter.512774.n5.nabble.com

Hi, I'm a fan of JMeter and have been on this mailing list several times over maybe 10 years. I am in the process of building a REST interface for a non-profit organization and I'd love to use JMeter to load-test it. However, it looks like the UI only shows GET and POST for HTTP methods. Would it be very ...

13. Is REST a kind of Web Service    coderanch.com

Hi, From blog to blog, I found some answers. REST vs SOAP is an old debate (2002) starting again from time to time. My understanding is that the arguments of REST advocates are too much B2C and human-user oriented. IMO, the field of WS is B2B and literal/document. Although WSDL can be considered complicated for human readers, this should not be ...

15. REST style web services    coderanch.com

All , I came across REST as the new mantra for WEB SERVICES . Can somebody throw light on it . Is it same as JAXWS*. Heard that AXIS 2.0 has started supporting it . Also AMAZON has 90% WEB SERVICES as REST. Some good book or link on how to implement this style of WEB SERVICES would be of great ...

16. Book Promo: Value of REST web services in the real world?    coderanch.com

My book is meant to be practical, and REST is practical. Many people find it much simpler and more intuitive than SOAP. So, yes, I think that there is tremendous value to including REST support in your SOA. Chapter 3 in my book describes one approach to REST using Java Web Services. In addition, there is a new API being developed ...





17. Mark Hansen : REST    coderanch.com

18. Mark Hansen - REST?    coderanch.com

REST is an architectural style, as described in the link provided by Prabhu. However, there is also a fundamental debate going on in the Web Services community under the headline of "REST vs. SOAP". In that context, "REST" doesn't really refer to the architectural style - it simply means using Plain Old XML (POX), together with HTTP, to communicate with a ...

19. Mark Hansen - REST vs SOA    coderanch.com

20. what are rest services    coderanch.com

21. Benefits of using REST style    coderanch.com

22. Options to get onto the REST bandwagon    coderanch.com

Hi there, I'm wondering about these 3 issues. Would love to know what other folks think about it 1) the easiest way to approach/demonstrate REST. Assuming someone has built a few webapps using java. Say, this developer/manager has worked with servlets and JSPs (and possibly Struts), what is the easiest way to get this developer to starting using REST architecture ? ...

23. What is REST?    coderanch.com

When I received the book promo email, I tried googling REST. My quick reading of the citations was not very helpful. I got that it is "an architectural style of networked systems." One said "The Web is a REST system!" So I put it to you, the experts: What is REST? Why should I care about it? What will I learn ...

24. Is REST practical ?    coderanch.com

John, A client for a RESTful service only uses the GET method to "get" data. The only data it must send along with GET is the name of the thing it wants to "get". Even a 256-character limit usually leaves enough room to say what you want to get, and most servers put the limit much higher. When you're sending a ...

25. What do I need to start developing REST apps ?    coderanch.com

That's a lot of work without much to show for it, but the result is RESTful. The difference between non-RESTful and RESTful here is the difference between "add" and "GET". Addition has become a noun: the result of addition. It's really just an implementation detail what the URI and the behind-the-scenes code look like. "A very tiny service" is one good ...

26. Why REST is getting alot of attention ?    coderanch.com

I far as I can tell the discussion on REST web services gained momentum back in 2002 (Roots of the REST/SOAP Debate) when it became apparent that there was nothing "simple" about SOAP. SOAP-based web services quickly became more and more complex to accommodate all sorts of features that benefited only a small percentage of applications but imposed the resulting complexity ...

27. REST acronym    coderanch.com

28. REST and loose coupling    coderanch.com

RESTful web services are said to be inherently loosely coupled because of the generic nature of the GET, PUT, POST, DELETE interface. What are some of the ways that could inadvertently undermine that loose coupling? By having addressable resources that are too finely grained? By sharing a resource name generation algorithm with the clients or having too many public resource names ...

29. time spans, REST and leasing    coderanch.com

One problem I have encountered when designing RESTful interfaces is that of resources with a limited timespan. It's often said of REST that a GET to the same URL should always return the same data. In many real-world applications this does not hold, though. Some data may only exist for a limited period, or only be available to a particular requester ...

30. Using REST for online purchases    coderanch.com

One of the common problems facing online purchase applications is where an accidental extra click submits an extra purchase. In traditional web apps this is solved in a variety of ways, usually involving sessions or other transaction state. I'm wondering what a recommended REST approach to this problem might be. As I see it the action of submitting details of a ...

32. REST vs HTML    coderanch.com

XML over HTTP isn't necessarily REST. The representation of a resource that you are accessing may be represented in XML but it could be represented in another way. Richardson & Ruby in their book RESTful Web Services (amazon US) actually choose HTML 5 as the representation format for their examples of the resource/representation design process. And there are instances of XML ...

33. JAX-WS and REST, anyone?    coderanch.com

I did some playing around with the service end of REST. Rather than mapping the request to a method, I mapped the request to a class - using an XML configuration file. Each class had its own doGet( request, response ) so taking apart the parameters was delegated to the class. After much wheel-spin with class loaders I got it to ...

34. Why REST is called lighter weight Web Service?    coderanch.com

The overhead on the client side in creating a SOAP request and sending it is really quite annoying. Creating a simple URL, creating a HttpURLConnection and doing a GET or POST is so very much simpler. On the server side parsing a SOAP request is time consuming also. REST is also lightweight because it discards all the SOAP baggage of WS-* ...

35. REST design question    coderanch.com

You seem to be overlooking the hypermedia aspect of REST. /app/latest can still return the JAD of the latest version. However the JAD already contains the version number - so why do you need /app/latest/version? more importantly /app should return a representation of the "directory of available versions". That representation could be in plain text CSV, XML, XHTML, or whatever is ...

36. How to create Rest based WEb service    coderanch.com

hi everyone, Im struck since many days as how to develop a REST based web service. Mostly all articles on net educates you to create service from popular IDEs like NetBeans, WSAD,etc. I want to develop a Hello Rest service that generates " XML response". My problem is im not getting the start point of it. Since java code automatically gets ...

37. REST server using Axis2/java - writing extensions    coderanch.com

I am new to Axis2 and Axis in general. I need to create REST services using Axis2/Java. I already know that Axis2 is supposed to support GET, POST, PUT and DELETE methods and also the possibility to write own extensions to it. What I want to do is create specific url to operation mapping and object serialization and deserialization. I figure ...

38. REST Filter    coderanch.com

39. How to develop REST based website.    coderanch.com

40. using a REST-based webservice    coderanch.com

I gather you are trying to make a client for an existing RESTful webservice. Typically you would create a HttpURLConnection to a URL and read the response stream according the type of the return. RESTful services are not restricted to returning XML, the returned stream could be any MIME type. Surely you have some sort of documentation on what this service ...

41. Rest Client    coderanch.com

43. Another REST issue    coderanch.com

44. JAX WS With REST    coderanch.com

45. how to go to last line of a file and skipping the rest?    coderanch.com

Well, there is a kludgy alternative if you can be sure that the last line is less than X characters long. You could open the file as a RandomAccessFile, seek to the end minus X bytes, read the last X bytes into a byte array and look backwards through that for the start of the last line. Turning the bytes located ...

46. No REST :(    coderanch.com

47. What's the typical performance of a trivial REST server?    coderanch.com

Something very trivial.. say, hello world on a typical developer's box. How many hello world's can it do per second, on localhost? Sorry about asking here instead of doing my own benchmark; there would be a major learning curve involved, and I am not sure I am going to even use it.

48. Consuming REST based web service    coderanch.com

I need help in consuming a REST based web service. I have to invoke the web service and authenticate it using Basic authentication. The service returns results in form of JSON. I found out that I can use Jersey API for consuming the service. I want to deserialize the JSON formatted string and create Java Beans/pojos. I do not know how ...

49. Implementing a client which uploads a file through Rest    coderanch.com

RESTful calls can be made over HTTP, in fact the are in your case just straight HTTP calls (GET, POST, PUT, DELETE). So using something like HttpClient from Apache as a helper library will allow you to make calls to a server. On the server side the service just has to respond to this HTTP request. I've found a nice way ...

50. REST Tutorials?    coderanch.com

51. Best Tools / IDE to use for REST?    coderanch.com

52. REST in mobiles    coderanch.com

53. REST in mobiles    coderanch.com

I don't see why you need a framework on the client - surely the REST response is unique to your application and needs custom code. If on the other hand you are talking about the server side, the Jersey toolkit looks good to me and is in the mainstream of Java development. Bill

54. Invoking REST webservices.    coderanch.com

Jersey is the reference implementation of the JAX-RS API, so I'd start by looking into that. While Axis2 can be used as client to any web service, it doesn't support JAX-RS specifically, which would rule it out in my book. It's really a SOAP stack, and that's what one should use it for.

56. REST Fileupload client    coderanch.com

I am new to REST implementation and i am trying to do fileupload using REST I am trying to use Jersey(But i am okay to any API) I would like to know some info regarding 1) Creation of client for uploading file (Finding hard time for how i can pass the file/path as a parameter ). 2) Is there anyway i ...

57. Getting started with ReST    coderanch.com

hi, i m using jboss5. Am in need of having a ReST implementation in my jb5 server. Be exact i need to have server methods like addUser, getUserName, deleteUser etc as my ReST methods that will access and get the data from other ejb session beans in my application and return the value. Can somebody please give a sample code for ...

58. Rest Web service    coderanch.com

59. Returning a String from Server (REST) and getting Errors..    coderanch.com

Hi all, I am trying to implement @GET variety of REST, the main idea is to return a String with the details of the Customer from Database.. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ // added this new method else everything is same.. package restresources; import java.lang.String; import java.sql.Connection; ...

60. REST based Web Service    coderanch.com

61. Tapestry + REST    coderanch.com

62. Using different Content Types for REST Webservices    coderanch.com

Hi all, We have implemented a REST webservice layer to access the application. The webservice layer handles XML as the content type from the POST request and as a return for GET request. However, the new requirement states that it should be able to consume and respond with JSON also along with XML. One solution that i can think of is ...

64. Rest Web services and EXT-JS    coderanch.com

66. sending java Object to REST web services.    coderanch.com

Hello Bill, thanks for the reply , what I understand from your reply is that I can use REST service instead of servlet in this scenario and it gives me the same bahaviour as I expect.I just have one small query can you tell me what MIME type should be specified in "consumes" tag for accepting the java object as an ...

67. Help needed in creating a webservice using REST    coderanch.com

The last time I looked, AXIS handled REST style calls by way of a Kludge which created a local SOAP request, executed it, and passed the result back as the REST result. Naturally all that SOAPing consumes time and memory, slowing up a simple REST action. Now - that was some time ago, maybe AXIS has a clean way of really ...

68. Deploying REST Webservice in Eclipse    coderanch.com

Hi, I need to develop a REST webservice in Eclipse. For this, I have written the service class as package rest; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; // POJO, no interface no extends //Sets the path to base URL + /hello @Path("/hello") public class Hello { // This method is called if TEXT_PLAIN is request @GET @Produces(MediaType.TEXT_PLAIN) public String ...

69. How to conserve the state with REST    coderanch.com

Hi! Looking at the Wikipedia article on REST and the constraints of the architectural style, you find statelessness. http://en.wikipedia.org/wiki/Representational_State_Transfer#Constraints In my opinion, there is nothing like a stateful REST service - it would be a contradiction. What may be useful in a situation like that is to change the mindset: What are you trying to accomplish by introducing a state? Would ...

70. standalone vs container REST service    coderanch.com

Though the question pertains to REST,it will apply to any service as such. I have come across fragments of information spread across but never a good design debate. What advantage do I get publishing the service as a standalone endpoint vs hosting it in a container. This is more relevant to REST where the primary medium of communication is HTTP,rather than ...

72. Get an OpenID token from a REST call    coderanch.com

73. REST WS Integration help    coderanch.com

Hi, I'm very new to REST and can't quite understand how it works. But now I'm in a situation where I need to learn, I've read some about it but have quite a hard time understanding exactly what it is and how it works. What I got is a quite large back-office system (with database and a front soap web-service) and ...

74. I presume REST and WS-I don't go together    coderanch.com

Hi, WS-I adds some more specifications to WebServices to provides things like security, addressing etc. in nearly all specs, it means that SOAP headers are updated. Therefore I presume, if you go with REST you can't use any WS-I specs. Therefore we are looking at custom, proprietary solutions for common problems. If I am correct, how did REST get so popular? ...

75. Bridge between REST & WS    coderanch.com

Hi all. I have a standard RESTful application (Jersey) which must call the equivalent WebService (Axis) on same TomCat server , both applications being mixed together (the basic Axis example plus the tiny REST stuff), the whole stuff linked with Spring. My problem is: REST call works, Axis call works, call of a REST HelloWorld which calls the same under Axis ...

76. returning a generic list from REST    coderanch.com

I'm trying to write some generic code that simplifies things for other developers in my company. I'm currently getting stuck returning a list of generic items from a REST web service public class genericREST { private static Client restWSClient; public static void main(String[] args) { restWSClient = Client.create(new DefaultClientConfig()); List list = getList1("http://localhost:8080/pathToResource"); for (MyComplexClass item : list) { System.out.println(item); } ...

77. Read rest of the string with Scanner class    coderanch.com

Hi, I have a string which contains different components delimited by different character. I managed to separate out the components but now I am not sure how to read the rest of the string? Example : abcd efgh:hijk restOfTheString component1 = abcd component2 = efgh component3 = hijk component4 = restOfTheString There is no specific delimiter for the rest of the ...

78. ERROR IN REST WEB SERVICES    coderanch.com

HI, I have created a rest web service using jersey and deployed in tomcat 7 while accessing the service its giving this error. i googled to resolve this issue but i couldn't found any related articles. java.lang.ClassNotFoundException: org.glassfish.external.probe.provider.PluginPoint at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521) at com.sun.jersey.server.spi.monitoring.glassfish.GlobalStatsProvider.register(GlobalStatsProvider.java:107) at com.sun.jersey.server.spi.monitoring.glassfish.GlassfishMonitoringServiceProvider.start(GlassfishMonitoringServiceProvider.java:56) at com.sun.jersey.server.spi.monitoring.glassfish.GlassfishMonitoringServiceProvider.register(GlassfishMonitoringServiceProvider.java:61) at com.sun.jersey.server.impl.monitoring.GlassFishMonitoringInitializer.initialize(GlassFishMonitoringInitializer.java:59) at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:582) at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311) at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:608) at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) at ...

79. Integration session-web service Rest    coderanch.com

80. web services in java using REST    coderanch.com

Hi All, I tried webservices using axis 1.5 where it uses JAX-RCP1.1 and everything went well. No I want to learn webservices using REST as I heard REST are light weight. Could some please let me know what are things i need to download to run on eclipse. is there any plugin for quick start? Thanks & regards, Sarada

81. Your thoughts on XML-RPC vs REST    coderanch.com

Hi All, I happened to step on a new topic while browsing, XML-RPC and out of curiousity I took a quick glance and found that it is passing XML over HTTP, which sounded same as REST style. I have to admit that I'm not really an experienced developer and quite often feel nervous when I ever I see a new buzz ...

83. REST WebServices    coderanch.com

Pavan, In the REST architectural style, data and functionality are considered resources and are accessed using Uniform Resource Identifiers (URIs), typically links on the Web. The resources are acted upon by using a set of simple, well-defined operations. The REST architectural style constrains an architecture to a client/server architecture and is designed to use a stateless communication protocol, typically HTTP. Java ...

84. Help with REST web service    coderanch.com

85. Standlaone Rest Services    coderanch.com

I will have to develop a standalone web service server with Java 5. I realised standalone jax-ws cannot be developed with java 5 and so able to figure out that a standalone Rest Services can be developed. I will appreciate, if any body could give me a link to a good tutorial or else exaplin how do i develop a standalone ...

86. Inputs to a REST webservice    coderanch.com

88. Craig McClanahan to Speak on Computing in the Cloud, REST and Building REST    forums.oracle.com

The architect of the Sun Java Studio Creator developer tool, [Craig McClanahan|http://www.developersummit.com/speakers.html#McClanahan], is coming this summer to India's biggest summit for the developer ecosystem - Great Indian Developer Summit (http://www.developersummit.com/). At the GIDS .Java conference on April 24th at the J N Tata Auditorium (Indian Institute of Science Campus) in Bangalore, Craig will conduct sessions on Cloud computing and REST. Craig ...

92. how to assign the FIRST string and into one var and assign the rest to othe    forums.oracle.com

Hi, I wanted to know and check if there is any class in java to support assignment of first value into one variable and assign the rest to another variable? String site = "11471047 PUOLUSTUSVOIMIEN JOHTAMISJ?RJESTELM?KESKUS HALLINNOLLINEN TIETOPALVELUKESKUS JYV?SKYL? FI" I wanted to assign the first text (11471047) to the variable siteId and the rest to siteName. please suggest.

93. inheritance problem first part compiles, but can't get the rest to compile.    forums.oracle.com

Purpose of Lab: Be able to: Write a Java program that defines, loads, and uses an array of objects. Create objects of classes. Understand the notion of polymorphism. Write superclasses and subclasses. Create objects of superclasses and subclasses. Instructions: 1. Write an Abstract Data Type called Animal. Include two instance variables in this class: a String for name and an integer ...

94. REST Webservice invocation from Java    forums.oracle.com

Hi Guys, I am developing an application that needs to invoke a REST webservice and submit XML data to it. The server will then process the request XML data, and return a result, etc. I have never worked with REST and have spent hours researching it on the NET. I have done SOAP calls in the past, but this seems to ...

95. reload applet without affecting rest of webpage.    forums.oracle.com

I have a webpage that has multiple applets in it. For one of the applets, I want to have a restart button that will essentially reload the applet without affecting the rest of the webpage. I see mentions of getAppletContext().showDocument(url) on other forums. But all of them seem to refresh the entire webpage. The start(), stop(), destroy() methods don't work for ...

96. Trying to develop simple REST client in Java 1.4.2    forums.oracle.com

XMLBeans allows you to generate an object model from the xml schema. You can then just deserialize the data from the InputStream available from the HttpConnection. Slightly more complex is to use JiBX which allows you to map xml into your own object structure. This can give you a more usable object structure then XMLBeans but takes more effort. There is ...

97. A little problem getting the style tag of a html file seperate from rest    forums.oracle.com

I've never tried it, but it seems like using an existing html parser would be a lot easier. I've worked with xml dom parsers, and it's not really that hard. I don't imagine working with an html dom would be too difficult either, at least it wouldn't be as hard as doing it by hand. Google for java html parser and ...

98. Reading n bytes from DatagramSocket without loosing the rest of the packet    forums.oracle.com

So I understand that it is not possible to use receive for reading n bytes from a received packet and then perform another receive to read the rest of the bytes in that previous packet. ByteArrayInputStream is a nice way to receive bytes but the problem is that I should specify a big size for the packet packet = new DatagramPacket(new ...