modified service example
* Fixed a bug that failed to encode dictionary object
* fixed memory leaks