1

I have

@PUT
@Path("{id}")
public Response modify(@PathParam("id") Integer id, 
                       @QueryParam("user") String user, @QueryParam("time") Date time) {....

I am trying to use RestClient to call this web service (the above is actually a cut down version of what I have)

When I call

..../123?user=user1

I hit the web service. As soon as I add time I get a 403 Forbidden message

..../123?user=user1&time=2013-09-10T20:00:00Z

Even if I pass nothing into the time query parameter I get the 403.

Is there anything difference about passing the java dates?

Thank in advance

RNJ
  • 14,884
  • 18
  • 80
  • 129
  • Have a look at this this question and accepted solution : http://stackoverflow.com/questions/9520716/cxf-jaxrs-how-do-i-pass-date-as-queryparam – Jayaram Sep 10 '13 at 10:18

2 Answers2

1

It's not able to deserialize the String to a Date. Two options are either you can modify the date string as accepted by the date class or use another form, such as a long value.

blackpanther
  • 10,360
  • 11
  • 46
  • 77
hanish.kh
  • 492
  • 3
  • 15
0

One observation: It seems you are adding an extra slash(/) before your query params:

change this

..../123/?user=user1&time=2013-09-10T20:00:00Z

to

..../123?user=user1&time=2013-09-10T20:00:00Z

Second thing is that you may have to encode your URL to send the date properly to server

Juned Ahsan
  • 66,028
  • 11
  • 91
  • 129