cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API with XML response

0 Kudos

Rest API with XML response

Feature request from ankursachdeva11, posted on GitHub Feb 01, 2016

I am trying to create custom api using webapi and we need output in custom XML. When we are trying to return some XML and hit the rest API url then XML shown as plain text in the .... tags. It is not creating XML in response.

it shows like this : image

Is there any way to modify the response tag to get custom XML response.

1 Comment
Senior Member

+1

 

By default Fieldnames are set to camel case.

 

 <orderItems>
                    <item>
                        <orderItemId>871</orderItemId>
                        <product>
                            <productId>329</productId>
                            <name>Chic</name>
                            <description></description>
                        </product>
                        <price/>
                        <quantity/>
                        <optionDesc/>
                        <deliveryDate/>
                        <priceFreight/>
                        <recipient>
                    ......
                    </item>
</orderItems>

I also need to be able to change the SOAP method names so that it's not always determined by "[module_name][version V1 or V2]"