Can i post a XML into a REST service call request?
I want to populate my POST call to a REST service with XML. Is this possible with Tiggzi, because it seems that you can only populate HTTP header fields......
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I want to populate my POST call to a REST service with XML. Is this possible with Tiggzi, because it seems that you can only populate HTTP header fields......
Hello,
If you set Method = Post, Content Type = "xml" in Rest Service parameters -
Tiggzi will send data to Rest Service as XML using POST method.
Hi Katya,
Thanks, but i have already set the method and content type like that. But where do i actually populate the xml itself? For instance, i have to post the following XML in the HTTP body as payload:
ProductName
commonj.sdo#String
Asperines
Price
commonj.sdo#Integer
3
Id
commonj.sdo#String
12345
Requestor
commonj.sdo#String
Rintje Ritsma
TotalAmount
commonj.sdo#Integer
5000
How and where can i set this?
You should create Rest Service with following Request parameters:
The following XML data will be sent in HTTP request:
code<?xml version="1.0" encoding="UTF-8"?>
<inputParameters>
<ProductName>Asperines</ProductName>
<Price>3</Price>
<TotalAmount>5000</TotalAmount>
</inputParameters> /code
If you need to send special XML you should use JavaScript (http://api.jquery.com/jQuery.ajax)
Thanks Katya. I assume that with special XML, you mean element attributes and namespace prefixes? In my case the rootelement needs to be qualified. Can i just use jquery ajax to only manipulate this element, so that i can still use the datamapper, or do i have to build the whole XML instead? Any recommendations on that?
If you need to send any special XML you can't use DataMapper.