Page 1 of 1

How to exclude "inputParameters" from the generated XML for REST call

Posted: Fri Jul 26, 2013 7:01 am
by apperydev77

I have complex input to my REST service so cannot use the mapper in the default manner. Currently I have my REST Service almost working but am stuck at the very end as the generated XML is begin wrapped in "inputParameters" which my service does not accept. How can I get the system to not wrap my input in this tag?


How to exclude "inputParameters" from the generated XML for REST call

Posted: Fri Jul 26, 2013 9:02 am
by Kateryna Grynko

Hi,

Could you please show us how you implement this? What's the service URL, service settings and request parameters you use to define the service?


How to exclude "inputParameters" from the generated XML for REST call

Posted: Fri Jul 26, 2013 3:42 pm
by apperydev77

I created a javascript method that builds the the XML body. This method is attached to service parameter under the form instance of the REST Method.

Mapper:

Image

Settings:

Image

Sample XML Request with the inputParameters( which is causing the problem)

Image


How to exclude "inputParameters" from the generated XML for REST call

Posted: Fri Jul 26, 2013 9:23 pm
by Maryna Brodina

Hello! You have two variables entity-ID and Invoice. If you wrap them with some common root element for example inputParameters - you won't get xml (because xml should have only one root element). That's why Appery.io automatically puts all parameters into element inputParameters. As a workaround you can create generic service and send data through ajax manually (without wrapping).


How to exclude "inputParameters" from the generated XML for REST call

Posted: Fri Jul 26, 2013 10:44 pm
by apperydev77

entity-ID is for the url replacement not for the content. How can I replace entity-ID in the url without adding a parameter on the request?


How to exclude "inputParameters" from the generated XML for REST call

Posted: Mon Jul 29, 2013 9:36 am
by Maryna Brodina

Hello! Even if you delete entity-ID from parameters list builder still wraps parameters into element inputParameters. Use Generic and send data through ajax manually (without wrapping).