I have this WebService with a webmethod tha returns XML, accessed by HTTP POST...
The webservice response is:
<?xml version="1.0" encoding="utf-8"?>
XML
For XML i create a XMLDocument into whom i load this string:
"<?xml-stylesheet type='text/xsl' href='http://localhost/myxslfile.xsl' ?><ReturnValue>answer from the WS</ReturnValue>"
my example XSL file (myxslfile.xsl) contents are:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<h3><xsl:value-of select="ReturnValue" /></h3>
</xsl:template>
</xsl:stylesheet>
Therefore, the Webservice response should be:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='http://localhost/myxslfile.xsl' ?><ReturnValue>answer from the WS</ReturnValue>
BUT IT KEEPS RETURNING ONLY
<?xml version="1.0" encoding="utf-8"?>
<ReturnValue>answer from the WS</ReturnValue>
Anyone knows what happened (obviously the Webservice took off the XSL reference), and how can i add that reference to the Output?
my method declaration is:
[WebMethod()]
public XmlDocument mymethod()
{
XmlDocument Retval = new XmlDocument();
string xml = "<?xml-stylesheet type='text/xsl' href='http://localhost/myxslfile.xsl' ?>"
+ "<ReturnValue>"
+ "answer from the WS" //Response String
+ "</ReturnValue>";
Retval.LoadXml(xml);
return Retval;
}
i even forced "<?xml version='1.0' ?><?xml-stylesheet type='text/xsl' href='http://www2.projectos.local/swsws/sws_sendsms.xsl' ?>" but it always keeps comming without those declarations.
Thanks in advance