Re: How to prevent DOS(Denial of Service) attacks for webservice?

2008-05-16 Thread Surjendu
Thanks Rob..Can u plz elaborate what do u mean by backed off timeouts for authentication failures. What else do u suggest for application level prevention for DOS attacks?

Re: Can't I pass an entity as part of HTTP.DELETE?

2008-05-15 Thread Surjendu
not allowing entities in get and delete, so we have created separate resource URI for delete requests and use POST/PUT to delete the resource on the server. Regards Surjendu

Re: Can't I pass an entity as part of HTTP.DELETE?

2008-05-14 Thread Surjendu
requests.We only recognize and honor web service request from our recognized partners. The actual user credentials who is requesting a deletion goes as part of entity to the deletion webservice call. I hope this makes sense. Regards Surjendu

Can I dynamically read the router attachments from a properties file or an xml?

2008-05-14 Thread Surjendu
Can I dynamically read the router attachments from a properties file or an xml? Key:/xxx/xxx Value: XXXResource.class The problem I am facing is: 1. In the application class If I have a createRoot method the flow takes me there directly. Now if i abstract the router attach key and value

Re: Can I dynamically read the router attachments from a properties file or an xml?

2008-05-14 Thread Surjendu
Thanks Stephan. Problem is I just found out that createRoot gets called before handle() and hence request.getResourceRef().toString() in createRoot is still null. If the flow is other way round then it would have solved the problem. Do u have any other way??

Does createRoot method gets called before handle method?

2008-05-14 Thread Surjendu
Does createRoot method gets called before handle method. In that case i can never get a handle of request in the createRoot method(though I know i can call super.handle in handle method later). But is there a way to get request object in the createRoot method?

Can't I pass an entity as part of HTTP.DELETE?

2008-05-13 Thread Surjendu
Can't I pass an entity as part of HTTP.DELETE? Does it act the same way as HTTP.GET? Even if I am passing entity as part of METHOD.DELETE in my request, the Resource class in the server doesn't receive anything. getRequest().isEntityAvailable() is false. And if the answer is yes can someone

Tomcat 5.0 with Restlet 1.1 throws nullpointer exception

2008-05-07 Thread Surjendu
When I use Tomcat 5.0 with the following restlet jars(1.0.9) my application works fine. org.restlet.jar(175,240) com.noelios.restlet.jar(150,630) com.noelios.restlet.ext.servlet_2.4.jar(14,115) When I try to use Tomcat 5.0 with the following restlet jars (1.1) my applications conks off.

Re: Tomcat 5.0 with Restlet 1.1 throws nullpointer exception

2008-05-07 Thread Surjendu
thanks Rob...downloaded M3 and everything works fine

java.util.zip.ZipException: no current ZIP entry..Any ideas

2008-05-07 Thread Surjendu
I am receiving the following exception when the entity is being set in the response. java.util.zip.ZipException: no current ZIP entry My code: File file = new File(c:\\temp.zip); rep = new FileRepresentation(file,MediaType.APPLICATION_ZIP); Representation zippedRep = new

Re: How to bundle 2 files in a Zip using EncodeRepresentation?

2008-05-06 Thread Surjendu
that. For your kind information this question regarding bundling 2 files in a Zip using EncodeRepresentation has been posted only once. Regards Surjendu

Re: How to bundle 2 files in a Zip using EncodeRepresentation?

2008-05-06 Thread Surjendu
Hi Jerome Sorry, after posting I realized that one of my team members already posted this question. My team uses the same login-id. My due apologizes to you. Regards Surjendu

How to bundle 2 files in a Zip using EncodeRepresentation?

2008-05-05 Thread Surjendu
see any constructor which takes a list of Representations. Something like EncodeRepresentation(Encoding encoding, ListwrappedRepresentation) In that case how will i bundle all the files in one zip. Regards Surjendu

Can someone plz answer my questions? I am stuck.

2008-05-02 Thread Surjendu
of a page) and an attachment(typically a File) back to the client as part of Response. Notwithstanding the drawbacks is there a way to solve this? Regards Surjendu

How to set multiple FileRepresentations in Reponse?

2008-05-01 Thread Surjendu
Can someone tell me how to send 4-5 attachments as part of response. I mean i can create a FileRepresentation using rep = new FileRepresentation(new File( xxx), MediaType.TEXT_PLAIN, 0); and set it in the response using getResponse().setEntity(rep); but how do I set multiple files in

Re: Send and Parse Attachment using Restlet

2008-04-30 Thread Surjendu
In that case how do someone using my web service can send me a request with an attachment. How to solve this use-case?

Re: Send and Parse Attachment using Restlet

2008-04-30 Thread Surjendu
Thanks Jerome What about the server code? Will Restlet be able to handle multi-part? If I use a http-client library to post the multi-part form request will the server code of Restlet( handlePost() method in Resource) be able to parse the request. If not how to achieve the same. What would

Re: handleGet and Entity

2008-04-30 Thread Surjendu
I do understand that GET is read-only. Say u want to retrieve SSN number of an individual. Before sending the SSN number we also need to see whether the user asking for the data is authorized to view that or not. I am not talking about Guard class authentication or authorization( custom

Credentials sent via Apache HttpClient not getting retrieved by Restlet Custom Guard classes

2008-04-30 Thread Surjendu
This is my client call using Apache HttpClient Library public static void addAttachment(String pageId) throws Exception { HttpClient client = new HttpClient(); MultipartPostMethod mPost = new MultipartPostMethod(getPageUri(pageId));

Re: Credentials sent via Apache HttpClient not getting retrieved by Restlet Custom Guard classes

2008-04-30 Thread Surjendu
I tried that..But i still get the credentials as null..Is there any other way to figure out whether the credentials are reaching the server.

Re: Credentials sent via Apache HttpClient not getting retrieved by Restlet Custom Guard classes

2008-04-30 Thread Surjendu
Thanks.. 1. I am using a Apache Http Client library as Restlet does not support multipart-form. As far as retrieving userid and password is concerned, thats not a problem because I have written custom Guard class which does exactly the same. When I use a challengeScheme(Restlet Client) in

handleGet and Entity

2008-04-29 Thread Surjendu
Even after i am passing an entity in the Request , I am not able to get it in handleGet() method. The same logic works for handlePut() and handlePost(). I am able to retrieve the entities in handlePost() and handlePut(). What is different for handleGet()? Why am I not able to retrieve the

How to read a file in the resource handlePut() sent by the request. Please help!!!!

2008-04-29 Thread Surjendu
Sending a file: Client Code: FileRepresentation rep = new FileRepresentation(C:\\input.txt, MediaType.MULTIPART_FORM_DATA, 0); Request request = new Request(Method.PUT,rep); Response resp = new Client(Protocol.HTTP).handle(request); My question is how to read the

Send and Parse Attachment using Restlet

2008-04-29 Thread Surjendu
); fi.write(saveTo); i++; } }catch(Exception e) { e.printstackTrace(); } I have also seen that I receive a multi-part error. How to solve this? Regards Surjendu

Re: Attachment

2008-04-28 Thread Surjendu
Thanks..Can u plz also tell me How do i send an attachment as part of the request to the server? Your earlier example suggest ways to send an attachment via response. I want to know how to send an attachment to the server via request. Regards Surjendu

Attachment

2008-04-25 Thread Surjendu
How to send an attachment using restlet? Please post some code snippet.

Re: Guarding all Resources using one Guard

2008-04-21 Thread Surjendu
Router(getContext()); guard.setNext(DomainResource.class); router.attach(/domain/{domainname}, guard); return router; Jerome/Barrie Plz respond. Regards Surjendu

Re: JSON Client and Restlet

2008-04-18 Thread Surjendu
Thank u so much sir...

Custom Guard's authenticate not getting invoked

2008-04-18 Thread Surjendu
I want to override the authenticate method in my custom Guard class. But the authenticate method of my custom Gurad class is never called?? Please help. The following code guards my router: @Override public Restlet createRoot() { Guard guard = new

How to get the real password and not encoded one....

2008-04-18 Thread Surjendu
If I do char[] secret = request.getChallengeResponse().getSecret(); I get an encoded value. What do I have to do to get the real password?

Guarding all Resources using one Guard

2008-04-18 Thread Surjendu
How can i guard all the Resources using a single Custom Guard class. By doing the following i can only guard a resource(which is working fine) public Restlet createRoot() { Guard guard = new SamePageGuard(getContext(),ChallengeScheme.HTTP_BASIC); Router router =

JSON and Restlet

2008-04-17 Thread Surjendu
the client to send me a query parameter asking what type of output he wants something like http://xxx/xxx/xxx?output=json Please help. Thanks Surjendu

JSON Client and Restlet

2008-04-17 Thread Surjendu
parameter asking what type of output he wants something like http://xxx/xxx/xxx?output=json Please help. Thanks Surjendu

Re: JSON Client and Restlet

2008-04-17 Thread Surjendu
(); form.add(domain[userId], userId); Everything is hunky-dory at this point. But What is the client is a JSON client? How do i parse the data in server? I mean will the same code work if the json string is something like domain[userId]:test Regards Surjendu

JSON Client and Restlet retreival

2008-04-17 Thread Surjendu
How can I parse a JSON request using Restlet? I tried using the following but it does not work? Do we have a different way of retreiving the JSON params? Form form = new Form(getRequest().getEntityAsForm()); String userid = form.getFirstValue(userId);

Can Rest handles complex posts?

2008-04-09 Thread Surjendu
Say I want to create 3 users. A user is designated by an User object. The User object has 4 attributes( FirstName,LastName,Email,BirthDate). How do i send this as part of WebForm?