I have implemented web services using Symfony 2.6
with FOSRestBundle
and JMSSerializerBundle
.
I can't manage to have a root element named request
eventhough I put xml_root_name: request
in the configuration file.
I have a config\serializer\Entity.Request.yml
file with the following information:
Tvjp\RequestBundle\Entity\Request:
exclusion_policy: ALL
xml_root_name: request
properties:
id:
expose: true
type: integer
label:
expose: true
type: string
issuer:
expose: true
type: string
When I try to access to a single request
, this is what I get in XML :
<result>
<id>23</id>
<label><![CDATA[ test label ws post ]]></label>
<issuer><![CDATA[ test issuer ws post ]]></issuer>
</result>
And what I get in json : {"id":23,"label":"test label ws post","issuer":"test issuer ws post"}
Any ideas what am I doing wrong here ?