Import XML from a string variable

0
I am calling this web service http://www.webservicex.net/globalweather.asmx?WSDL which returns just one string parameter for the request getWeather. But the string returned is actually a complex xml object, something like <?xml version="1.0" encoding="utf-16" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:<?xml version="1.0" encoding="utf-16"?> <CurrentWeather> <Location>Amsterdam Airport Schiphol, Netherlands (EHAM) 52-18N 004-46E -2M</Location> <Time>Jul 02, 2012 - 06:55 AM EDT / 2012.07.02 1055 UTC</Time> .. </CurrentWeather> All I want is to map the xml of this string to an entity and display it in a form. But how? I have defined an XMLtodomain mapping and then tried to Import XML (microflow action) but this only works with xml document as an input and not with a string variable. Ideally, I would call Input XML with my string as parameter and this action would parse the XML out of the string for me and map it to an existing entity according to my XMLtodomain mapping. Any suggestions?
asked
2 answers
0

I am afraid you need to make a custom java action for that. Unfortunately there are a lot of ‘webservices’ that make the same mistake. In the java action capture the string, do a replace all <xs:schema xmlns.*<="" xs:schema=""> with empty string and save the xml filedocument. Then you can do the mapping.

answered
0

You can use the community commons StoreUrlToFiledocument. That stores the xml in a file document which can be imported in a microflow import xml action.

answered