Page 1 of 1

Can i post a XML into a REST service call request?

Posted: Mon Jan 21, 2013 8:19 pm
by Jeroen Jansen

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......


Can i post a XML into a REST service call request?

Posted: Mon Jan 21, 2013 8:30 pm
by Kateryna Grynko

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.


Can i post a XML into a REST service call request?

Posted: Mon Jan 21, 2013 8:35 pm
by Jeroen Jansen

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?


Can i post a XML into a REST service call request?

Posted: Mon Jan 21, 2013 9:05 pm
by Kateryna Grynko

You should create Rest Service with following Request parameters:
Image

The following XML data will be sent in HTTP request:
code<?xml version="1&#46;0" encoding="UTF-8"?>
<inputParameters>
<ProductName>Asperines<&#47;ProductName>
<Price>3<&#47;Price>
<TotalAmount>5000<&#47;TotalAmount>
<&#47;inputParameters> /code
If you need to send special XML you should use JavaScript (http://api.jquery.com/jQuery.ajax)


Can i post a XML into a REST service call request?

Posted: Tue Jan 22, 2013 9:16 am
by Jeroen Jansen

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?


Can i post a XML into a REST service call request?

Posted: Tue Jan 22, 2013 9:46 am
by Kateryna Grynko

If you need to send any special XML you can't use DataMapper.