1
I need to save in the directory a return of a webservice
.
How do I save the value of this variable ret
in an archive xml
.
Return: XML of type Results.xsd
I tried so:
WSHP.XMLServer ws = new WSHP.XMLServer();
var xml = GerarXMLConsulta();
string login = "12000";
string senha = "4329";
var ret = ws.getResultado(login, senha, xml);
XmlSerializer ser = new XmlSerializer(typeof(Resultados));
FileStream arquivo = new FileStream("D:\\downloads\\Retorno.xml", FileMode.CreateNew);
ser.Serialize(arquivo, ret);
The Visual Studio
error return:
Cannot convert an object of type 'System.String' in type 'Modulolabels.Results'.
var ret = ws.getResultado(login, senha, xml);
returns an object or an xml?– Renan
Returns an XML.
– João Bosco
And you want to put the xml in a file?
– Renan
string return = Ws.getResult(login, password, xml); precise saves the return variable in an xml.xml for another system to load that file.
– João Bosco