Re: [Cppcms-users] CppCMS handle SOAP or RESTful like Web Services?
Brought to you by:
artyom-beilis
|
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
>
>
>
|