Hello, this is my first post so sorry for the language errors
My question is how to remove an xml row so that I read the json data
<? Wersja xml = "1.0" encoding = "utf-8"?> <String xmlns = "http://tempuri.org/"> łańcuch </ string>
Thank you very much for help @gamoraes
My mistake was that I did not know how to write the expression.
For beginners show my flow
Hi @goliaaat sorry for the delay, and thanks to post the webservice, help a lot.
You need to use this expression in your compose:
json(replace(replace(replace(actionBody('HTTP'),'<?xml version="1.0" encoding="utf-8"?>',''),'<string xmlns="http://tempuri.org/">',''),'</string>',''))
where the text in red is the name of your Http Action, with this function you'll have only the json and in json type for use, if you need only strng, can remove the json text of expression
Best Regards,
Gustavo Moraes
Hello
He tried different json forms and every time there is an error
{ "?xml": { "version": "1.0", "encoding": "utf-8" }, "string": { "xmlns": "http://tempuri.org/" }, "root": { "person": [{ "type": "object", "properties": { "ZP_400_Kryteria": { "type": "array", "items": { "type": "object", "properties": { "GuidZP400": { "type": "string" }, "Kryteria": { "type": "string" }, "Znaczenie": { "type": "string" } }, "required": ["GuidZP400", "Kryteria", "Znaczenie"] } } } } ] } }
error code
„Unexpected character encountered while parsing value: <. Path '', line 0, position 0.”
The fact that I do not know the json programming of the second option can not be implemented.
PublicWebService information page
http://websrv.bzp.uzp.gov.pl/BZP_PublicWebService.asmx?op=KryteriaDoZP400_JSON
Body
_ZP400Guid=ba1f8e2d-5d57-4c0f-8ad7-83537f9aaba1
Please help @gamoraes
Hi @goliaaat
You can use 2 functions to resolve your problem:
1- Use Json() expression to parse this string in a compose and after access the correct property:
Input = "<?xml version="1.0"?> <root> <person id='1'> <name>Alan</name> <occupation>Engineer</occupation> </person> </root>"
Example = Json("<?xml version='1.0'?> <root> <person id='1'> <name>Alan</name> <occupation>Engineer</occupation> </person> </root>")
Output = "{ "?xml": { "@version": "1.0" }, "root": { "person": [ { "@id": "1", "name": "Alan", "occupation": "Engineer" } ] } }"
2 - Use Replace expression to remove the literal text <xml....>
Example = replace('the old string', 'old', 'new')
Hope Have Helped,
Gustavo Moraes