Factorize serialize/deserialize soap methods

* factorize serialize/deserialize soap methods
* add tests