cppcms-users Mailing List for CppCMS C++ Web Framework (Page 89)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
| 2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
| 2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
| 2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
| 2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
| 2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
| 2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
| 2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
| 2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
| 2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2026 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Artyom B. <art...@ya...> - 2012-04-23 11:30:11
|
>Thanks for your reply, there. >I'm a little unsure about the backtrace, though, sorry -- > I haven't explicitly setup any logging (I'm still finding my way, really), so there won't be anything there. What you see is already log, if logging is not defined it goes to stderr >Do you mean that I should include the test_backtrace compilation you suggest into my project compilation? >& sorry if I'm being dense. :) No, I do not have latest Mac OS X, only Darwin 8 (~Mac OS X 10.4) so I could not test backtrace feature that should be available in latest versions of Mac OS X. Generally you should be able to see a stack bactrace for exceptions thrown by CppCMS in the log (if this feature works) It would be nice if you could check it with the test program I had pointed to. By compilation and running this program you can see if you actually getting any stack trace or not. So if you could compile and run the program with the parameters I had shown it could answer on the question whether backtrace works on Mac OS X or not. Thats it. > Doug. > > Artyom |
|
From: doug l. <bi...@gm...> - 2012-04-23 11:25:26
|
Thanks for your reply, there. I'm a little unsure about the backtrace, though, sorry -- I haven't explicitly setup any logging (I'm still finding my way, really), so there won't be anything there. Do you mean that I should include the test_backtrace compilation you suggest into my project compilation? & sorry if I'm being dense. :) Doug. |
|
From: Tero M. <te...@gm...> - 2012-04-23 06:53:51
|
Hi, what Object Relation Mapping (ORM) library should I choose for my CppCMS application? Tero |
|
From: Artyom B. <art...@ya...> - 2012-04-23 06:30:43
|
Two things. 1. This exception is thrown when you try to access a file (cppcms::widgets::file::value()) and the file was not uploaded. You can check if the file was uploaded by using cppcms::widgets::file::set() member function before using value. See: http://cppcms.com/cppcms_ref/latest/classcppcms_1_1widgets_1_1file.html#a56ee053415b1bd98944bb3599e3392b1 2. To debug this problem you should be able to see full stack backtrace in the log - and AFAIR it should work under Mac OS X, if not tell me. To check if backtrace works, please compile booster/lib/backtrace/test/test_backtrace.cpp As g++ -O0 -dynamic booster/lib/backtrace/test/test_backtrace.cpp -lbooster And see if you get stack trace when you run the program. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: doug livesey <bi...@gm...> >To: cpp...@li... >Sent: Sunday, April 22, 2012 11:08 PM >Subject: [Cppcms-users] Advice on debugging file upload > > >Hi -- I'm trying to develop an image server which raises the following error when I send a post request to create a new file: > > >2012-04-22 20:55:28; cppcms, error: Caught exception [File was not loaded] >0x10176c2b3: cppcms::cppcms_error::cppcms_error(std::string const&) + 0x63 in /usr/local/lib/libcppcms.1.dylib > (http_context.cpp:139) > > >Could anyone offer me any advice on good ways to start debugging to find the source of the error, here? >Thanks, > Doug. >------------------------------------------------------------------------------ >For Developers, A Lot Can Happen In A Second. >Boundary is the first to Know...and Tell You. >Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >http://p.sf.net/sfu/Boundary-d2dvs2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: doug l. <bi...@gm...> - 2012-04-22 20:08:40
|
Hi -- I'm trying to develop an image server which raises the following error when I send a post request to create a new file: 2012-04-22 20:55:28; cppcms, error: Caught exception [File was not loaded] 0x10176c2b3: cppcms::cppcms_error::cppcms_error(std::string const&) + 0x63 in /usr/local/lib/libcppcms.1.dylib (http_context.cpp:139) Could anyone offer me any advice on good ways to start debugging to find the source of the error, here? Thanks, Doug. |
|
From: doug l. <bi...@gm...> - 2012-04-22 13:51:07
|
Ah, well I was too dumb to know I wasn't being dumb, then. Which I'll leave as a paradox to unravel another time ... ;) Thanks very much for the link, there! On 22 April 2012 14:45, Artyom Beilis <art...@ya...> wrote: > Not a dumb question, and your solution is not correct: > > but there is an answer: > > http://cppcms.com/wikipp/en/page/run_application_web_server_root > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* doug livesey <bi...@gm...> > *To:* cpp...@li... > *Sent:* Sunday, April 22, 2012 4:39 PM > *Subject:* Re: [Cppcms-users] Using root dir as application root > > Okay, dumb question, sorry! > I just did it by changing the "script_names" config param to [ "/"] > -- I thought I'd struggled with this before, but I guess not. :) > > On 22 April 2012 14:37, doug livesey <bi...@gm...> wrote: > > Hi -- all of the tutorials seem to use a non-root directory (such as > "hello/" or "myapp/") as the root for the application. > Is it possible with cppcms to have the root directory be the application > root? > So that, for example, I could make the hello world application run in the > browser from "http://localhost:8080/"? > Cheers, > Doug. > > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Artyom B. <art...@ya...> - 2012-04-22 13:45:25
|
Not a dumb question, and your solution is not correct: but there is an answer: http://cppcms.com/wikipp/en/page/run_application_web_server_root Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: doug livesey <bi...@gm...> >To: cpp...@li... >Sent: Sunday, April 22, 2012 4:39 PM >Subject: Re: [Cppcms-users] Using root dir as application root > > >Okay, dumb question, sorry! >I just did it by changing the "script_names" config param to [ "/"] >-- I thought I'd struggled with this before, but I guess not. :) > > >On 22 April 2012 14:37, doug livesey <bi...@gm...> wrote: > >Hi -- all of the tutorials seem to use a non-root directory (such as "hello/" or "myapp/") as the root for the application. >>Is it possible with cppcms to have the root directory be the application root? >>So that, for example, I could make the hello world application run in the browser from "http://localhost:8080/"? >>Cheers, >> Doug. > >------------------------------------------------------------------------------ >For Developers, A Lot Can Happen In A Second. >Boundary is the first to Know...and Tell You. >Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >http://p.sf.net/sfu/Boundary-d2dvs2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: doug l. <bi...@gm...> - 2012-04-22 13:40:23
|
Okay, dumb question, sorry! I just did it by changing the "script_names" config param to [ "/"] -- I thought I'd struggled with this before, but I guess not. :) On 22 April 2012 14:37, doug livesey <bi...@gm...> wrote: > Hi -- all of the tutorials seem to use a non-root directory (such as > "hello/" or "myapp/") as the root for the application. > Is it possible with cppcms to have the root directory be the application > root? > So that, for example, I could make the hello world application run in the > browser from "http://localhost:8080/"? > Cheers, > Doug. > |
|
From: doug l. <bi...@gm...> - 2012-04-22 13:37:41
|
Hi -- all of the tutorials seem to use a non-root directory (such as "hello/" or "myapp/") as the root for the application. Is it possible with cppcms to have the root directory be the application root? So that, for example, I could make the hello world application run in the browser from "http://localhost:8080/"? Cheers, Doug. |
|
From: <ele...@ex...> - 2012-04-22 07:26:24
|
> It is in Doxygen API: > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1session__interface.html#details My bad, i should have read it more thoroughly. Highlighting it would be great too. Cheers, Petr |
|
From: Artyom B. <art...@ya...> - 2012-04-22 06:37:07
|
>________________________________ > From: "ele...@ex..." <ele...@ex...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Sunday, April 22, 2012 5:05 AM >Subject: Re: [Cppcms-users] app().session().erase() doesn't work or not permitted? > >> You can't do changes in session **after** writing **any** output >> (including just accessing to response().out() without actual I/O) >> > >I figured that out while reading the header file for session_interface. Do >you think it may be handy to include that in the doxygen API >documentation? Or maybe have it spit out a warning? > It is in Doxygen API: http://cppcms.com/cppcms_ref/latest/classcppcms_1_1session__interface.html#details Quoting: All changes in session should be done before headers are written to the output (before requesting an output stream from http::response object) Also It seems that it should be more "highlighted" there. Because it is quite FAQ there. Artyom |
|
From: <ele...@ex...> - 2012-04-22 02:59:05
|
#include <cppcms/http_request.h>
Petr
> ... since i asked something that RTFM could have solved, i wrote the
> RESTful WS example (attached). i hope that's what everybody has in mind.
> i am open to learning.
>
> a couple of things i have yet to figure out:
>
> if (request().request_method() != "GET") ...
>
> if (request().content_type() == "application/xml") ...
>
> gave me errors at compilation time:
>
> g++ -I include -c -O2 -Wall -g src/base_rest_ws.cpp -o obj/base_rest_ws.o
> src/base_rest_ws.cpp: In member function bool
> base_rest_ws::is_request_method_get():
> src/base_rest_ws.cpp:39:15: error: invalid use of incomplete type
> struct cppcms::http::request
> /usr/local/include/cppcms/application.h:41:9: error: forward declaration
> of struct cppcms::http::request
>
> g++ -I include -c -O2 -Wall -g src/users.cpp -o obj/users.o
> src/users.cpp: In member function void users::count():
> src/users.cpp:78:38: error: invalid use of incomplete type struct
> cppcms::http::request
> /usr/local/include/cppcms/application.h:41:9: error: forward declaration
> of struct cppcms::http::request
>
> maybe somebody can set me straight on those.
>
> cheers!
>
> k
>
> On 04/19/2012 02:50 PM, Klaus Wenger wrote:
>> thx artyom!
>>
>> i should have re-read the product planning page. i am looking forward to
>> the
>> rest support that does handle the scope and the encoded parameters. i
>> was
>> just lately looking at other c++ web frameworks that allow you to
>> register a
>> class and its methods to handle the rest call and get the scope and
>> parameters resolved and fed.
>>
>> great many thanks!
>>
>> k
>>
>> "Artyom Beilis"<art...@ya...> wrote in
>> message
>> news:133...@we......
>>> Note, today it is really not a problem to implement RESTful web
>>>
>>> services with CppCMS.
>>>
>>> Note REST is not a protocol like "JSON-RPC" is just
>>> general guidelines.
>>>
>>> So:
>>>
>>> 1. Create a mapping between resource and function/application
>>> 2. Handle requests differently for PUT/GET/DELETE etc.
>>>
>>>
>>>
>>> void myhandler(std::string resource_id)
>>> {
>>> if(request().method() == "GET") {
>>> ...
>>>
>>> }
>>> else if(request().method() == "PUT") {
>>> ...
>>>
>>> }
>>> else if(request().method() == "DELETE") { ... }
>>>
>>> }
>>>
>>>
>>>
>>> And so on, so RESTful service implementation with CppCMS
>>> is quite trivial.
>>>
>>>
>>>
>>> Artyom Beilis
>>> --------------
>>> CppCMS - C++ Web Framework: http://cppcms.com/
>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>>>
>>>
>>>
>>>> ________________________________
>>>> From: william lee<we...@gm...>
>>>> To: cpp...@li...
>>>> Sent: Thursday, April 19, 2012 5:54 AM
>>>> Subject: Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web
>>>> Services?
>>>>
>>>>
>>>> Hi Klaus,
>>>> According to roadmap, it is planned to address in 1.3.0 or later :)
>>>> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services
>>>>
>>>> Artyom can correct me if I'm wrong.
>>>>
>>>>
>>>> thanks,
>>>> William L.
>>>>
>>>>
>>>> On Wed, Apr 18, 2012 at 10:58 PM, Klaus Wenger
>>>> <kjw...@ya...> wrote:
>>>>
>>>> thank you guys for the useful thread!
>>>>>
>>>>> are there any plans on providing a rest_ws scaffold somewhat similar
>>>>> to
>>>>> rpc_json? any quick example to show the best practice?
>>>>>
>>>>> stay cool!
>>>>>
>>>>> k
>>>>>
>>>>>
>>>>> On 04/17/2012 07:28 AM, william lee wrote:
>>>>>> Thanks Artyom, it is clear to me now.
>>>>>>
>>>>>> Best Regards,
>>>>>> William L.
>>>>>>
>>>>>> On Tue, Apr 17, 2012 at 6:14 PM, Artyom Beilis
>>>>>> <art...@ya...
>>>>>
>>>>>> <mailto:art...@ya...>> wrote:
>>>>>>
>>>>>> >Hi,
>>>>>>
>>>>>> >If I want to use CppCMS framework provide web services like
>>>>>> SOAP
>>>>>> or RESTFul etc,
>>>>>> >Shall I need to use cppcms::http::request::raw_post_data()
>>>>>> and
>>>>>> parse the XML by myself?
>>>>>> >
>>>>>>
>>>>>> Yes, raw_post_data() created exactly for this purpose and for
>>>>>> example
>>>>>> JSON-RPC API uses it.
>>>>>>
>>>>>>
>>>>>> >
>>>>>> >
>>>>>> >CppCMS has built-in support for JSON-RPC, and any
>>>>>> recommendation
>>>>>> for handle other web services? :)
>>>>>> >
>>>>>>
>>>>>> JSON-RPC is provided as most lightweight and efficient
>>>>>> services,
>>>>>> that can be easily integrated with client (both Browser and
>>>>>> other client that generates JSON-RPC requests)
>>>>>>
>>>>>>
>>>>>> (Note that JSON is much more lightweight format then XML...)
>>>>>>
>>>>>> If you want to create other services you may want to use your
>>>>>> favorite
>>>>>>
>>>>>> XML library (tinyxml, libxml2 etc) and you may generate
>>>>>> responses
>>>>>> as XML using both CppCMS templates language or generate XML
>>>>>> using
>>>>>> your favorite XML library.
>>>>>>
>>>>>> Also note that for RESTFul services the url-dispatching/mapping
>>>>>> services
>>>>>> fit very well as it allows to handle proper hierarchy easily.
>>>>>>
>>>>>> Artyom
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>>> resolution app monitoring today. Free.
>>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>>> _______________________________________________
>>>>>> Cppcms-users mailing list
>>>>>> Cpp...@li...
>>>>>>
>>>>>> <mailto:Cpp...@li...>
>>>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>>> resolution app monitoring today. Free.
>>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>> resolution app monitoring today. Free.
>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>> _______________________________________________
>>>>> Cppcms-users mailing list
>>>>> Cpp...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> For Developers, A Lot Can Happen In A Second.
>>>> Boundary is the first to Know...and Tell You.
>>>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>>>> http://p.sf.net/sfu/Boundary-d2dvs2
>>>> _______________________________________________
>>>> Cppcms-users mailing list
>>>> Cpp...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>
>>>>
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> For Developers, A Lot Can Happen In A Second.
>>> Boundary is the first to Know...and Tell You.
>>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>>> http://p.sf.net/sfu/Boundary-d2dvs2
>>
>>
>>
>> ------------------------------------------------------------------------------
>> For Developers, A Lot Can Happen In A Second.
>> Boundary is the first to Know...and Tell You.
>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>> http://p.sf.net/sfu/Boundary-d2dvs2
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2_______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|
|
From: <ele...@ex...> - 2012-04-22 02:05:19
|
> You can't do changes in session **after** writing **any** output > (including just accessing to response().out() without actual I/O) > I figured that out while reading the header file for session_interface. Do you think it may be handy to include that in the doxygen API documentation? Or maybe have it spit out a warning? > Because it allows to use lazy evaluation, caching etc... You will not find > many Thanks! Petr |
|
From: Klaus W. <kjw...@ya...> - 2012-04-21 20:35:15
|
... since i asked something that RTFM could have solved, i wrote the
RESTful WS example (attached). i hope that's what everybody has in mind.
i am open to learning.
a couple of things i have yet to figure out:
if (request().request_method() != "GET") ...
if (request().content_type() == "application/xml") ...
gave me errors at compilation time:
g++ -I include -c -O2 -Wall -g src/base_rest_ws.cpp -o obj/base_rest_ws.o
src/base_rest_ws.cpp: In member function ‘bool
base_rest_ws::is_request_method_get()’:
src/base_rest_ws.cpp:39:15: error: invalid use of incomplete type
‘struct cppcms::http::request’
/usr/local/include/cppcms/application.h:41:9: error: forward declaration
of ‘struct cppcms::http::request’
g++ -I include -c -O2 -Wall -g src/users.cpp -o obj/users.o
src/users.cpp: In member function ‘void users::count()’:
src/users.cpp:78:38: error: invalid use of incomplete type ‘struct
cppcms::http::request’
/usr/local/include/cppcms/application.h:41:9: error: forward declaration
of ‘struct cppcms::http::request’
maybe somebody can set me straight on those.
cheers!
k
On 04/19/2012 02:50 PM, Klaus Wenger wrote:
> thx artyom!
>
> i should have re-read the product planning page. i am looking forward to the
> rest support that does handle the scope and the encoded parameters. i was
> just lately looking at other c++ web frameworks that allow you to register a
> class and its methods to handle the rest call and get the scope and
> parameters resolved and fed.
>
> great many thanks!
>
> k
>
> "Artyom Beilis"<art...@ya...> wrote in
> message news:133...@we......
>> Note, today it is really not a problem to implement RESTful web
>>
>> services with CppCMS.
>>
>> Note REST is not a protocol like "JSON-RPC" is just
>> general guidelines.
>>
>> So:
>>
>> 1. Create a mapping between resource and function/application
>> 2. Handle requests differently for PUT/GET/DELETE etc.
>>
>>
>>
>> void myhandler(std::string resource_id)
>> {
>> if(request().method() == "GET") {
>> ...
>>
>> }
>> else if(request().method() == "PUT") {
>> ...
>>
>> }
>> else if(request().method() == "DELETE") { ... }
>>
>> }
>>
>>
>>
>> And so on, so RESTful service implementation with CppCMS
>> is quite trivial.
>>
>>
>>
>> Artyom Beilis
>> --------------
>> CppCMS - C++ Web Framework: http://cppcms.com/
>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>>
>>
>>
>>> ________________________________
>>> From: william lee<we...@gm...>
>>> To: cpp...@li...
>>> Sent: Thursday, April 19, 2012 5:54 AM
>>> Subject: Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web
>>> Services?
>>>
>>>
>>> Hi Klaus,
>>> According to roadmap, it is planned to address in 1.3.0 or later :)
>>> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services
>>>
>>> Artyom can correct me if I'm wrong.
>>>
>>>
>>> thanks,
>>> William L.
>>>
>>>
>>> On Wed, Apr 18, 2012 at 10:58 PM, Klaus Wenger
>>> <kjw...@ya...> wrote:
>>>
>>> thank you guys for the useful thread!
>>>>
>>>> are there any plans on providing a rest_ws scaffold somewhat similar to
>>>> rpc_json? any quick example to show the best practice?
>>>>
>>>> stay cool!
>>>>
>>>> k
>>>>
>>>>
>>>> On 04/17/2012 07:28 AM, william lee wrote:
>>>>> Thanks Artyom, it is clear to me now.
>>>>>
>>>>> Best Regards,
>>>>> William L.
>>>>>
>>>>> On Tue, Apr 17, 2012 at 6:14 PM, Artyom Beilis
>>>>> <art...@ya...
>>>>
>>>>> <mailto:art...@ya...>> wrote:
>>>>>
>>>>> >Hi,
>>>>>
>>>>> >If I want to use CppCMS framework provide web services like SOAP
>>>>> or RESTFul etc,
>>>>> >Shall I need to use cppcms::http::request::raw_post_data() and
>>>>> parse the XML by myself?
>>>>> >
>>>>>
>>>>> Yes, raw_post_data() created exactly for this purpose and for
>>>>> example
>>>>> JSON-RPC API uses it.
>>>>>
>>>>>
>>>>> >
>>>>> >
>>>>> >CppCMS has built-in support for JSON-RPC, and any recommendation
>>>>> for handle other web services? :)
>>>>> >
>>>>>
>>>>> JSON-RPC is provided as most lightweight and efficient services,
>>>>> that can be easily integrated with client (both Browser and
>>>>> other client that generates JSON-RPC requests)
>>>>>
>>>>>
>>>>> (Note that JSON is much more lightweight format then XML...)
>>>>>
>>>>> If you want to create other services you may want to use your
>>>>> favorite
>>>>>
>>>>> XML library (tinyxml, libxml2 etc) and you may generate responses
>>>>> as XML using both CppCMS templates language or generate XML using
>>>>> your favorite XML library.
>>>>>
>>>>> Also note that for RESTFul services the url-dispatching/mapping
>>>>> services
>>>>> fit very well as it allows to handle proper hierarchy easily.
>>>>>
>>>>> Artyom
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>> resolution app monitoring today. Free.
>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>> _______________________________________________
>>>>> Cppcms-users mailing list
>>>>> Cpp...@li...
>>>>>
>>>>> <mailto:Cpp...@li...>
>>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>> resolution app monitoring today. Free.
>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>> _______________________________________________
>>>> Cppcms-users mailing list
>>>> Cpp...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> For Developers, A Lot Can Happen In A Second.
>>> Boundary is the first to Know...and Tell You.
>>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>>> http://p.sf.net/sfu/Boundary-d2dvs2
>>> _______________________________________________
>>> Cppcms-users mailing list
>>> Cpp...@li...
>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> For Developers, A Lot Can Happen In A Second.
>> Boundary is the first to Know...and Tell You.
>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>> http://p.sf.net/sfu/Boundary-d2dvs2
>
>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
|
|
From: Klaus W. <kjw...@ya...> - 2012-04-21 20:29:57
|
... since i asked something that RTFM could have solved, i wrote the
RESTful WS example (attached). i hope that's what everybody has in mind.
i am open to learning.
a couple of things i have yet to figure out:
if (request().request_method() != "GET") ...
if (request().content_type() == "application/xml") ...
gave me errors at compilation time:
g++ -I include -c -O2 -Wall -g src/base_rest_ws.cpp -o obj/base_rest_ws.o
src/base_rest_ws.cpp: In member function ‘bool
base_rest_ws::is_request_method_get()’:
src/base_rest_ws.cpp:39:15: error: invalid use of incomplete type
‘struct cppcms::http::request’
/usr/local/include/cppcms/application.h:41:9: error: forward declaration
of ‘struct cppcms::http::request’
g++ -I include -c -O2 -Wall -g src/users.cpp -o obj/users.o
src/users.cpp: In member function ‘void users::count()’:
src/users.cpp:78:38: error: invalid use of incomplete type ‘struct
cppcms::http::request’
/usr/local/include/cppcms/application.h:41:9: error: forward declaration
of ‘struct cppcms::http::request’
maybe somebody can set me straight on those.
cheers!
k
On 04/19/2012 02:50 PM, Klaus Wenger wrote:
> thx artyom!
>
> i should have re-read the product planning page. i am looking forward to the
> rest support that does handle the scope and the encoded parameters. i was
> just lately looking at other c++ web frameworks that allow you to register a
> class and its methods to handle the rest call and get the scope and
> parameters resolved and fed.
>
> great many thanks!
>
> k
>
> "Artyom Beilis"<art...@ya...> wrote in
> message news:133...@we......
>> Note, today it is really not a problem to implement RESTful web
>>
>> services with CppCMS.
>>
>> Note REST is not a protocol like "JSON-RPC" is just
>> general guidelines.
>>
>> So:
>>
>> 1. Create a mapping between resource and function/application
>> 2. Handle requests differently for PUT/GET/DELETE etc.
>>
>>
>>
>> void myhandler(std::string resource_id)
>> {
>> if(request().method() == "GET") {
>> ...
>>
>> }
>> else if(request().method() == "PUT") {
>> ...
>>
>> }
>> else if(request().method() == "DELETE") { ... }
>>
>> }
>>
>>
>>
>> And so on, so RESTful service implementation with CppCMS
>> is quite trivial.
>>
>>
>>
>> Artyom Beilis
>> --------------
>> CppCMS - C++ Web Framework: http://cppcms.com/
>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>>
>>
>>
>>> ________________________________
>>> From: william lee<we...@gm...>
>>> To: cpp...@li...
>>> Sent: Thursday, April 19, 2012 5:54 AM
>>> Subject: Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web
>>> Services?
>>>
>>>
>>> Hi Klaus,
>>> According to roadmap, it is planned to address in 1.3.0 or later :)
>>> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services
>>>
>>> Artyom can correct me if I'm wrong.
>>>
>>>
>>> thanks,
>>> William L.
>>>
>>>
>>> On Wed, Apr 18, 2012 at 10:58 PM, Klaus Wenger
>>> <kjw...@ya...> wrote:
>>>
>>> thank you guys for the useful thread!
>>>>
>>>> are there any plans on providing a rest_ws scaffold somewhat similar to
>>>> rpc_json? any quick example to show the best practice?
>>>>
>>>> stay cool!
>>>>
>>>> k
>>>>
>>>>
>>>> On 04/17/2012 07:28 AM, william lee wrote:
>>>>> Thanks Artyom, it is clear to me now.
>>>>>
>>>>> Best Regards,
>>>>> William L.
>>>>>
>>>>> On Tue, Apr 17, 2012 at 6:14 PM, Artyom Beilis
>>>>> <art...@ya...
>>>>
>>>>> <mailto:art...@ya...>> wrote:
>>>>>
>>>>> >Hi,
>>>>>
>>>>> >If I want to use CppCMS framework provide web services like SOAP
>>>>> or RESTFul etc,
>>>>> >Shall I need to use cppcms::http::request::raw_post_data() and
>>>>> parse the XML by myself?
>>>>> >
>>>>>
>>>>> Yes, raw_post_data() created exactly for this purpose and for
>>>>> example
>>>>> JSON-RPC API uses it.
>>>>>
>>>>>
>>>>> >
>>>>> >
>>>>> >CppCMS has built-in support for JSON-RPC, and any recommendation
>>>>> for handle other web services? :)
>>>>> >
>>>>>
>>>>> JSON-RPC is provided as most lightweight and efficient services,
>>>>> that can be easily integrated with client (both Browser and
>>>>> other client that generates JSON-RPC requests)
>>>>>
>>>>>
>>>>> (Note that JSON is much more lightweight format then XML...)
>>>>>
>>>>> If you want to create other services you may want to use your
>>>>> favorite
>>>>>
>>>>> XML library (tinyxml, libxml2 etc) and you may generate responses
>>>>> as XML using both CppCMS templates language or generate XML using
>>>>> your favorite XML library.
>>>>>
>>>>> Also note that for RESTFul services the url-dispatching/mapping
>>>>> services
>>>>> fit very well as it allows to handle proper hierarchy easily.
>>>>>
>>>>> Artyom
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>> resolution app monitoring today. Free.
>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>> _______________________________________________
>>>>> Cppcms-users mailing list
>>>>> Cpp...@li...
>>>>>
>>>>> <mailto:Cpp...@li...>
>>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Better than sec? Nothing is better than sec when it comes to
>>>>> monitoring Big Data applications. Try Boundary one-second
>>>>> resolution app monitoring today. Free.
>>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>> _______________________________________________
>>>> Cppcms-users mailing list
>>>> Cpp...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> For Developers, A Lot Can Happen In A Second.
>>> Boundary is the first to Know...and Tell You.
>>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>>> http://p.sf.net/sfu/Boundary-d2dvs2
>>> _______________________________________________
>>> Cppcms-users mailing list
>>> Cpp...@li...
>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> For Developers, A Lot Can Happen In A Second.
>> Boundary is the first to Know...and Tell You.
>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>> http://p.sf.net/sfu/Boundary-d2dvs2
>
>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
|
|
From: Artyom B. <art...@ya...> - 2012-04-21 15:38:16
|
>
> string msg;
>
> if (app().session().is_set("msg")) {
> msg = app().session().get("msg"); //works
> app().session().erase("msg"); // doesn't work
> }
>
> return msg; // always returns text because it never gets erased
>
> Is modifying a session via app().session() not permitted or is it a bug?
> Erasing the key from controller works fine.
>
You can't do changes in session **after** writing **any** output
(including just accessing to response().out() without actual I/O)
> Another question - why is session_interface::get() not const?
>
Because it allows to use lazy evaluation, caching etc... You will not find many
const member functions in general withing CppCMS for this reason.
> Cheers,
> Petr
>
Artyom
|
|
From: Artyom B. <art...@ya...> - 2012-04-21 15:31:39
|
>> It works, with manipulators:
>>
>> ss >> booster::locale::as::ftime("%Y-%m-%d") >> dt;
>
> Is there a way to check for such failure(ie. does it throw?)
>
The error is reported as any error in istream parsing: failbit.
Read about error handling for C++ I/O stream
Artyom
|
|
From: <ele...@ex...> - 2012-04-20 03:00:04
|
I've just added a simple message to be displayed on website.
ie.
session().set("msg", "User Updated");
And then in my content class I have a get_message() function which gets
called from inside a template.
get_message() does simple -
string msg;
if (app().session().is_set("msg")) {
msg = app().session().get("msg"); //works
app().session().erase("msg"); // doesn't work
}
return msg; // always returns text because it never gets erased
Is modifying a session via app().session() not permitted or is it a bug?
Erasing the key from controller works fine.
Another question - why is session_interface::get() not const?
Cheers,
Petr
|
|
From: <ele...@ex...> - 2012-04-20 01:47:43
|
Aaah excellent.
What happens if the time string doesn't match the format? ie. the
time/date is 2001/12/01 and ftime is set to %Y-%m-%d
Is there a way to check for such failure(ie. does it throw?)
Thanks!
Petr
> It works, with manipulators:
>
> ss >> booster::locale::as::ftime("%Y-%m-%d") >> dt;
>
> It requires CppCMS to be compiled with ICU.
>
> Artyom
>
|
|
From: Klaus W. <kjw...@ya...> - 2012-04-19 18:51:24
|
thx artyom!
i should have re-read the product planning page. i am looking forward to the
rest support that does handle the scope and the encoded parameters. i was
just lately looking at other c++ web frameworks that allow you to register a
class and its methods to handle the rest call and get the scope and
parameters resolved and fed.
great many thanks!
k
"Artyom Beilis" <art...@ya...> wrote in
message news:133...@we......
> Note, today it is really not a problem to implement RESTful web
>
> services with CppCMS.
>
> Note REST is not a protocol like "JSON-RPC" is just
> general guidelines.
>
> So:
>
> 1. Create a mapping between resource and function/application
> 2. Handle requests differently for PUT/GET/DELETE etc.
>
>
>
> void myhandler(std::string resource_id)
> {
> if(request().method() == "GET") {
> ...
>
> }
> else if(request().method() == "PUT") {
> ...
>
> }
> else if(request().method() == "DELETE") { ... }
>
> }
>
>
>
> And so on, so RESTful service implementation with CppCMS
> is quite trivial.
>
>
>
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
>
>
>>________________________________
>> From: william lee <we...@gm...>
>>To: cpp...@li...
>>Sent: Thursday, April 19, 2012 5:54 AM
>>Subject: Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web
>>Services?
>>
>>
>>Hi Klaus,
>>According to roadmap, it is planned to address in 1.3.0 or later :)
>>http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services
>>
>>Artyom can correct me if I'm wrong.
>>
>>
>>thanks,
>>William L.
>>
>>
>>On Wed, Apr 18, 2012 at 10:58 PM, Klaus Wenger
>><kjw...@ya...> wrote:
>>
>>thank you guys for the useful thread!
>>>
>>>are there any plans on providing a rest_ws scaffold somewhat similar to
>>>rpc_json? any quick example to show the best practice?
>>>
>>>stay cool!
>>>
>>>k
>>>
>>>
>>>On 04/17/2012 07:28 AM, william lee wrote:
>>>> Thanks Artyom, it is clear to me now.
>>>>
>>>> Best Regards,
>>>> William L.
>>>>
>>>> On Tue, Apr 17, 2012 at 6:14 PM, Artyom Beilis
>>>> <art...@ya...
>>>
>>>> <mailto:art...@ya...>> wrote:
>>>>
>>>> >Hi,
>>>>
>>>> >If I want to use CppCMS framework provide web services like SOAP
>>>> or RESTFul etc,
>>>> >Shall I need to use cppcms::http::request::raw_post_data() and
>>>> parse the XML by myself?
>>>> >
>>>>
>>>> Yes, raw_post_data() created exactly for this purpose and for
>>>> example
>>>> JSON-RPC API uses it.
>>>>
>>>>
>>>> >
>>>> >
>>>> >CppCMS has built-in support for JSON-RPC, and any recommendation
>>>> for handle other web services? :)
>>>> >
>>>>
>>>> JSON-RPC is provided as most lightweight and efficient services,
>>>> that can be easily integrated with client (both Browser and
>>>> other client that generates JSON-RPC requests)
>>>>
>>>>
>>>> (Note that JSON is much more lightweight format then XML...)
>>>>
>>>> If you want to create other services you may want to use your
>>>> favorite
>>>>
>>>> XML library (tinyxml, libxml2 etc) and you may generate responses
>>>> as XML using both CppCMS templates language or generate XML using
>>>> your favorite XML library.
>>>>
>>>> Also note that for RESTFul services the url-dispatching/mapping
>>>> services
>>>> fit very well as it allows to handle proper hierarchy easily.
>>>>
>>>> Artyom
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>> _______________________________________________
>>>> Cppcms-users mailing list
>>>> Cpp...@li...
>>>>
>>>> <mailto:Cpp...@li...>
>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>>
>>>
>>>
>>>
>>>------------------------------------------------------------------------------
>>>Better than sec? Nothing is better than sec when it comes to
>>>monitoring Big Data applications. Try Boundary one-second
>>>resolution app monitoring today. Free.
>>>http://p.sf.net/sfu/Boundary-dev2dev
>>>_______________________________________________
>>>Cppcms-users mailing list
>>>Cpp...@li...
>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>>
>>
>>------------------------------------------------------------------------------
>>For Developers, A Lot Can Happen In A Second.
>>Boundary is the first to Know...and Tell You.
>>Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>>http://p.sf.net/sfu/Boundary-d2dvs2
>>_______________________________________________
>>Cppcms-users mailing list
>>Cpp...@li...
>>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>>
>>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
|
|
From: Artyom B. <art...@ya...> - 2012-04-19 11:19:02
|
>
> Does this work for both string-to-date_time as wells as date_time-to-string?
>
> I'm aware of strftime, and all, but that's in reverse. I'm looking
> for
> something like time_input_facet that's in boost::posix_time allowing me to
> parse a string/char into time.
>
> Perhaps something like
>
> istringstram ss("2001-12-12");
> date_time dt;
>
> ss >> format("%Y-%m-%d") >> dt;
>
It works, with manipulators:
ss >> booster::locale::as::ftime("%Y-%m-%d") >> dt;
It requires CppCMS to be compiled with ICU.
Artyom
|
|
From: <ele...@ex...> - 2012-04-19 10:45:47
|
On the other hand would this work? ( i don't have a C++ compiler on this
windows laptop to try it)
double t;
istringstream is("2001-12-12");
is >> as::ftime("%Y-%m-%d") >> t;
date_time dt(t);
Petr
|
|
From: <ele...@ex...> - 2012-04-19 10:34:12
|
Does this work for both string-to-date_time as wells as date_time-to-string?
I'm aware of strftime, and all, but that's in reverse. I'm looking for
something like time_input_facet that's in boost::posix_time allowing me to
parse a string/char into time.
Perhaps something like
istringstram ss("2001-12-12");
date_time dt;
ss >> format("%Y-%m-%d") >> dt;
would be really handy. The examples of date and time formatting on the
page you pointed out seem to only show output streams (date to string
formatting), but maybe I'm not seeing something obvious in which case I
apologize.
Cheers
Petr
> To parse date-time read
>
>
> http://www.boost.org/doc/libs/1_49_0/libs/locale/doc/html/formatting_and_parsing.html
>
> Just change "boost" to "booster"
>
> Note to parse booster::locale::date_time you need to compile CppCMS with
> ICU.
>
|
|
From: Artyom B. <art...@ya...> - 2012-04-19 08:30:41
|
Note, today it is really not a problem to implement RESTful web
services with CppCMS.
Note REST is not a protocol like "JSON-RPC" is just
general guidelines.
So:
1. Create a mapping between resource and function/application
2. Handle requests differently for PUT/GET/DELETE etc.
void myhandler(std::string resource_id)
{
if(request().method() == "GET") {
...
}
else if(request().method() == "PUT") {
...
}
else if(request().method() == "DELETE") { ... }
}
And so on, so RESTful service implementation with CppCMS
is quite trivial.
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>________________________________
> From: william lee <we...@gm...>
>To: cpp...@li...
>Sent: Thursday, April 19, 2012 5:54 AM
>Subject: Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web Services?
>
>
>Hi Klaus,
>According to roadmap, it is planned to address in 1.3.0 or later :)
>http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services
>
>Artyom can correct me if I'm wrong.
>
>
>thanks,
>William L.
>
>
>On Wed, Apr 18, 2012 at 10:58 PM, Klaus Wenger <kjw...@ya...> wrote:
>
>thank you guys for the useful thread!
>>
>>are there any plans on providing a rest_ws scaffold somewhat similar to
>>rpc_json? any quick example to show the best practice?
>>
>>stay cool!
>>
>>k
>>
>>
>>On 04/17/2012 07:28 AM, william lee wrote:
>>> Thanks Artyom, it is clear to me now.
>>>
>>> Best Regards,
>>> William L.
>>>
>>> On Tue, Apr 17, 2012 at 6:14 PM, Artyom Beilis
>>> <art...@ya...
>>
>>> <mailto:art...@ya...>> wrote:
>>>
>>> >Hi,
>>>
>>> >If I want to use CppCMS framework provide web services like SOAP
>>> or RESTFul etc,
>>> >Shall I need to use cppcms::http::request::raw_post_data() and
>>> parse the XML by myself?
>>> >
>>>
>>> Yes, raw_post_data() created exactly for this purpose and for example
>>> JSON-RPC API uses it.
>>>
>>>
>>> >
>>> >
>>> >CppCMS has built-in support for JSON-RPC, and any recommendation
>>> for handle other web services? :)
>>> >
>>>
>>> JSON-RPC is provided as most lightweight and efficient services,
>>> that can be easily integrated with client (both Browser and
>>> other client that generates JSON-RPC requests)
>>>
>>>
>>> (Note that JSON is much more lightweight format then XML...)
>>>
>>> If you want to create other services you may want to use your favorite
>>>
>>> XML library (tinyxml, libxml2 etc) and you may generate responses
>>> as XML using both CppCMS templates language or generate XML using
>>> your favorite XML library.
>>>
>>> Also note that for RESTFul services the url-dispatching/mapping services
>>> fit very well as it allows to handle proper hierarchy easily.
>>>
>>> Artyom
>>>
>>> ------------------------------------------------------------------------------
>>> Better than sec? Nothing is better than sec when it comes to
>>> monitoring Big Data applications. Try Boundary one-second
>>> resolution app monitoring today. Free.
>>> http://p.sf.net/sfu/Boundary-dev2dev
>>> _______________________________________________
>>> Cppcms-users mailing list
>>> Cpp...@li...
>>> <mailto:Cpp...@li...>
>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Better than sec? Nothing is better than sec when it comes to
>>> monitoring Big Data applications. Try Boundary one-second
>>> resolution app monitoring today. Free.
>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>
>>
>>
>>
>>------------------------------------------------------------------------------
>>Better than sec? Nothing is better than sec when it comes to
>>monitoring Big Data applications. Try Boundary one-second
>>resolution app monitoring today. Free.
>>http://p.sf.net/sfu/Boundary-dev2dev
>>_______________________________________________
>>Cppcms-users mailing list
>>Cpp...@li...
>>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>
>------------------------------------------------------------------------------
>For Developers, A Lot Can Happen In A Second.
>Boundary is the first to Know...and Tell You.
>Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
>http://p.sf.net/sfu/Boundary-d2dvs2
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
|
|
From: Artyom B. <art...@ya...> - 2012-04-19 08:26:38
|
To parse date-time read http://www.boost.org/doc/libs/1_49_0/libs/locale/doc/html/formatting_and_parsing.html Just change "boost" to "booster" Note to parse booster::locale::date_time you need to compile CppCMS with ICU. Otherwise you can use booster::ptime and std::tm <-> booster::ptime/time_t conversions. http://cppcms.com/cppcms_ref/latest/classbooster_1_1ptime.html#a5d69b8e68c9847834ee984bfd19be8b5 > not what was requested either: > http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Implement.Locale.sensitive.Date- > Time.Form.Widgets > "Implement Locale sensitive Date-Time Form Widgets > ICU provides good features for parsing and formatting dates and times, > implement Date-Time Widget for this purpose." Note this mostly related to forms/widgets. CppCMS supports date-time parsing. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > |