How to serialize or deserialize an xml string in K2 five?

938 Views Asked by At

I have created a REST api service broker in K2 five. One of the api returns an xml string. Is there any way to deserialize it in K2 five and get the tags and the values which I am interested in?

I tried looking for ways in K2 five but could not understand if we need to create a customized smartobject and somehow use it for deserialization. But even then how will it be dynamically generated?

Also, if I have a view containing - let say, name and number. Given an xml schema, can it be serialized into xml string and use in the body of PUT api.

1

There are 1 best solutions below

3
On

If it would be possible to instruct your API to send you JSON from your APIs instead of XML, you might use Deserialize that should be available in definition of your SmartObjects which you created from swagger file for your REST service. If you cannot change response, then you can create a C# utility DLL that performs deserialization from XML and expose that DLL as a Endpoint Assembly using Endpoint service broker.