Andrea,

I have the SSL working fine when I call it from a Java program using
HttpsURLConnection. So it was something with "curl."  

I wonder if you could suggest how I could pass a username and password along
with the json string and authenticate the request.

Thanks,

Bruce

-----Original Message-----
From: Andrea Del Bene [mailto:[email protected]] 
Sent: Thursday, July 31, 2014 8:06 AM
To: [email protected]
Subject: Re: Wicketstuff restannotations example throws
IllegalStateException: STREAMED with https

I started the example app with Maven and enabling the SSL port. I've tested
it with Firefox, although I had to disable the flag
security.mixed_content.block_active_content to load the JS libraries. I had
no problem with the REST operations (GET, POST, DELETE...), everything
worked fine usin SSL. Maybe the problem is with curl and SSL handling?
> I just stated it by running Start.java as a java application  to start
Jetty from Eclipse.
>
> Bruce
>
> Sent from my iPad
>
>> On Jul 31, 2014, at 6:09 AM, Andrea Del Bene <[email protected]>
wrote:
>>
>> Hi,
>>
>> how did you started the example application?
>>> I want to use the wicketstuff-restannotations library to implement a 
>>> restful web service. It seem very handy and I was able to get the 
>>> example code working fine.
>>>
>>> To make sure I understood how everything was working and how to 
>>> access from another server I used curl from the command line to send an
HTTP request.
>>>
>>> It worked fine using http with jetty, but when I tried 
>>> http://localhost:8443 I get  IllegalStateException: STREAMED.
>>>
>>> See the details below:
>>>
>>>   
>>> The following works using curl to post:
>>>
>>>   
>>> C:\Software\Curl>curl
>>>
>>> -H "Content-Type: application/json"
>>>
>>> -d {"name":"Bruce","email":"[email protected]","password":"piano"}
>>>
>>> http://localhost:8080/personsmanager/createPerson
>>>
>>>   
>>> It returns this:
>>>
>>>   
>>> {"name":"Bruce","email":"[email protected]","password":"piano"}
>>>
>>>   
>>> With the following HTTPS curl command I get IllegalStateException: 
>>> STREAMED
>>> (note: the " -k/ --insecure" switch tells curl not to validate the 
>>> certificate since it is not in their list)
>>>
>>>   
>>> C:\Software\Curl>curl
>>>
>>> -H -k/ --insecure "Content-Type: application/json"
>>>
>>> -d {"name":"Bruce","email":"[email protected]","password":"piano"}
>>> https://localhost:8443
>>>
>>> /personsmanager/persons
>>>
>>>   
>>> Stacktrace shows:
>>>
>>>   
>>> java.lang.IllegalStateException: STREAMED
>>>
>>>                  at
>>> org.eclipse.jetty.server.Request.getReader(Request.java:787)
>>>
>>>                  at
>>> org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(Http
>>> Utils.ja
>>> va:46)
>>>
>>>                  at
>>> org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerial
>>> Deserial
>>> .requestToObject(TextualWebSerialDeserial.java:83)
>>>
>>>                  at
>>> org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObj
>>> ectFromR
>>> equest(MethodParameter.java:278)
>>>
>>>                  at
>>> org.wicketstuff.rest.utils.reflection.MethodParameter.extractParamet
>>> erFromAn
>>> notation(MethodParameter.java:168)
>>>
>>>                  at
>>> org.wicketstuff.rest.utils.reflection.MethodParameter.extractParamet
>>> erValue(
>>> MethodParameter.java:117)
>>>
>>>   
>>> Does this mean that it the restful annotation will not work over 
>>> https, or am I doing something wrong?
>>>
>>>   
>>> Bruce
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to