Re: XML senden/emfangen

Tech-Archive recommends: Fix windows errors by optimizing your registry





Zerberus wrote:

Ich muss die XML-Daten einfach per Http Post versenden, genau!

Hier ein Beispiel, das XML per XmlTextWriter erzeugt und per HTTP POST versendet:
<http://groups.google.com/group/microsoft.public.de.german.entwickler.dotnet.csharp/msg/92e8900f3dc5e6d6?hl=en&;>
So du dann auch XML empfangen willst und per einer .NET XML-API (wie XmlDocument, XmlTextReader) verarbeiten willst, musst du halt nur am Ende z.b.
XmlDocument responseXML = new XmlDocument();
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
responseXML.Load(httpResponse.GetResponseStream());
oder
XmlTextReader xmlTextReader = new XmlTextReader(httpResponse.GetResponseStream());
while (xmlTextReader.Read()) {
...
}
statt der Ausgabe per Console.WriteLine durchführen.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.



Relevant Pages

  • Re: How to call aspx page from C#
    ... this url from within a function and getting the xml as output from the function) so that my code can parse the xml got in return. ... you to pass in your sUrl, you can use an XmlTextReader e.g. ... XPathDocument xPathDocument = new XPathDocument; ... XmlDocument xmlDocument = new XmlDocument; ...
    (microsoft.public.dotnet.xml)
  • Re: xml node
    ... taken by the recursive function and get to all the other Xml Nodes.How do I do that? ... the Load method of an XmlDocument on an XmlTextReader is all you are looking for: ... XmlDocument xmlDocument = new XmlDocument; ...
    (microsoft.public.dotnet.xml)
  • RE: Add Namespaces with XmlTextReader and XmltextWriter?
    ... Microsoft MSDN Online Support Lead ... Add Namespaces with XmlTextReader and XmltextWriter? ... Regarding on the question about add namespace into certain element in XML ...
    (microsoft.public.dotnet.framework)
  • Re: XmlTextReader - Problem
    ... Allerdings meint der XmlTextReader jetzt an ... einigen Dokumenten an der Stelle 4099 eine erneute Xml-Deklaration zu finden ... Sichere ich das XML ... Fehler, auch nicht, wenn ich den String in einen XmlTextReader lade. ...
    (microsoft.public.de.german.entwickler.dotnet.framework)
  • Re: Problem with XMLTextReader
    ... i have to use XMLTextReader because of its advantages. ... use filestreams and load the complete info to a string and then using ... it turns out that spaces before the xml declaration is not fully ... > You could preload the file into a string and Trim the spaces then pass the ...
    (microsoft.public.dotnet.xml)