I am trying to understand the basic flow of a system consisting of:
C#client/program/app which will query thePHPserver.PHPserver.Couchbaseserver running onLinux.
On the client side I have some classes, class MyClass {int,string,list etc}.
Based on other questions and answers, the flow should look like this:
C# client class->serialize to JSON-> post as string to PHP page-> (on PHP page) deserialize JSON string to PHP class ->posting to Couchbase -> getting result -> serialize to JSON->post as JSON string and return to the C# client -> etc
- Is that correct? Any suggestions?
- What are the best tools/packages, easiest way to serialize from
JSONand toJSONinPHP?
Thanks for your help!
Couchbase 2.0 is a database that allows you to store document directly. As soon as you have the JSON string you can store it into Couchbase using the PHP Client SDK.
That said, if you have a PHP object and you can use the json_encode()/json_decode() functions that are available in PHP.
You can take a look the the Getting Started and Tutorial from Couchbase:
– http://www.couchbase.com/docs/couchbase-sdk-php-1.1/tutorial.html
Also you can look at this interested library that allows you to develop with PHP and Couchbase easily:
– https://github.com/Basement/Basement
You can look to use it, or look to see how it uses PHP and JSON.