I have a web service that is used to retrieve a list of db entries based on the entry clicked by the user. This is all working fine. At the moment though I build a string of HTML code inside the web service and return this to my Javascript to render it to the screen.
What I think might be better is to return an XML document to the Javascript and then handle the HTML rendering in there. But, I can't quite figure out how to return the result as an XML document. I think I need to use XMLTextWriter but I'm not sure how to write the XML to a variable and return that.
At the moment I have:-
I think once I get the stream bit and what I should be returning the document as, I should be OK. It's these bits I'm unsure of.Code:<WebMethod>_ Public Function GetList(ByVal ref as integer) As ? what do I return it as? XMLDocument? Dim XMLresult as new XmlTextWriter( this would normally be a path to an XML file or response.OutputStream. What should I use as the stream?
What I want returned is something like:-
Or if an error occurs, something like:-Code:<filenotelist> <filenote> <title>Filenote 1</title> <dateadded>25/03/09</dateadded> <note>Some text</note> </filenote> <filenote> <title>Filenote 2</title> <dateadded>24/03/09</dateadded> <note>Some more text</note> </filenote> </filenotelist>
Code:<filenotelist> <error>There was an error</error> </filenotelist>



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks