@Nagaev

> I changed your code to work as expected:

No, it does not work. Are you trying the example with the wthttp
server that comes with Wt or are you trying this with FCGI connector?
I am using Apache+fcgid and it does not work for me. If you try to
access the example "hello" RESTful API mentioned in my original post,
you will get an html page back (refer the output file attached with
the original post). If you want to understand what actually happens
when that RESTful API is invoked, try accessing it via Firefox instead
of cURL. When you access the API via Firefox, there are actually 6
requests sent to the server (5 GET and 1 POST). These extra request
are injected by Wt. Also the URL is modified by Wt to include
sessionID and other parameters. The WResource is not created and
registered until after the first few GET requests that Wt generates.
Even after that the handleRequest method of the resource is never
called because the EntryPoint deduced by Wt for any of the 6 requests
is never of type StaticResource. So I am missing something here. Its
not just the code, it is also about how to invoke the RESTful API for
Wt service. It will be helpful if someone can point me to a simple
"hello world" RESTful service example that works under FCGI connector.


> 1. remove #if macros

Well if you do not define WITH_APP then you get essentially what you
suggest in following two points.

> 2. remove call of Wt::WRun, which used to prevent the program to enter 
> try-catch.
> 3. remove RestApplication class (which is not needed for this example)

Just don't define WITH_APP and it should be okay.


> 4. add beingDeleted(); to ~RestGetHello() (as as stated in documentation)

Yep, missed that. Thanks!

Kind regards,

~Plug

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to