Hello all,
I have a requirement to to return a XML response for incoming posts to my
webservice. In addition, I can not write out to a file. I must process this
in memory. The XML response must be as follows
<xml version='1.0' standalone='no'?><!DOCTYPE SMSRESPONSE SYSTEM
'response_generic_v1.dtd'>
<SMSRESPONSE>
<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>
<SMSRESPONSE>
-------------------------------------------------------------------------------------------
I coded a simple web service to see if i could return the right format as
follows
<WebMethod()> Public Function Sms() As Xml.XmlDocument
Dim strResponseData As String
Dim objXMLResponseDocument As Xml.XmlDocument = New Xml.XmlDocument
strResponseData = "<?xml version='1.0' standalone='no'?><!DOCTYPE
SMSRESPONSE SYSTEM 'response_generic_v1.dtd'>"
strResponseData += "<SMSRESPONSE>"
strResponseData += "<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>"
strResponseData += "</SMSRESPONSE>"
objXMLResponseDocument.LoadXml(strResponseData)
Return objXMLResponseDocument
End Function
-------------------------------------------------------------------------------------------
When i call the function i get the following back
<?xml version="1.0" encoding="utf-8" ?>
<SMSRESPONSE>
<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>
</SMSRESPONSE>
-------------------------------------------------------------------------------------------
I've tried everything to return the right format with no luck..
BTW: I added a few lines to dump the xml to a file before the return
[strOut.WriteLine(objXMLResponseDocument.OuterXml)]
and the resulting flat file is correct.