RESTful web service response return value is a JavaScript object. This JavaScript object is serialized and placed in the body of the HTTP Response.
Is there way somehow to control this serialization process?
I want the attributes of this JavaScript object to be serialized to XML attributes (Not XML Elements)
Example:
JSON response:
- Code: Select all
{
"JMF": {
"Response": {
"Type": "SubmissionMethods",
"ReturnCode": "0",
"ID": "SubmissionMethodsResponse_Q38BE5CF9-F912-4E18-8F76-C3DB8B9CEEE2",
"refID": "Q38BE5CF9-F912-4E18-8F76-C3DB8B9CEEE2",
"SubmissionMethods": {
"Packaging": "MIME",
"URLSchemes": "file http"
}
}
}
}
XML Response:
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<JMF>
<Response>
<Type>SubmissionMethods</Type>
<ReturnCode>0</ReturnCode>
<ID>SubmissionMethodsResponse_Q38BE5CF9-F912-4E18-8F76-C3DB8B9CEEE2</ID>
<refID>Q38BE5CF9-F912-4E18-8F76-C3DB8B9CEEE2</refID>
<SubmissionMethods>
<Packaging>MIME</Packaging>
<URLSchemes>file http</URLSchemes>
</SubmissionMethods>
</Response>
</JMF>
I want "<Packaging>MIME</Packaging>" to be an attribute of "SubmissionMethods" XML Element etc.
Thanks, Anton