![]() |
Web-Browser Webservice Response in LV übernehmen - Druckversion +- LabVIEWForum.de (https://www.labviewforum.de) +-- Forum: LabVIEW (/Forum-LabVIEW) +--- Forum: LabVIEW Allgemein (/Forum-LabVIEW-Allgemein) +---- Forum: Datenbank & File IO (/Forum-Datenbank-File-IO) +---- Thema: Web-Browser Webservice Response in LV übernehmen (/Thread-Web-Browser-Webservice-Response-in-LV-uebernehmen) |
Web-Browser Webservice Response in LV übernehmen - HansimGlück - 05.05.2008 14:59 Hallo, ich nutze einen Webbrowser (z.B. IE), um aus LV heraus eine zuvor generierte HTML-Requestdatei (test.html) via Webservice auf einen Webserver zu senden und dessen xml-Response automatisch über ein eingebautes Javascript im Browserfenster abzuholen. Wie kann man auf einfache Weise VOLLAUTOMATISCH die xml-Response z.B. in einen String oder in eine Textdatei speichern zur weiteren Verarbeitung in LV? P.S. Für diesen Webserver gibt es hier im Forum auch eine Beipiellösung mit direktem Webservice-Aufruf aus LV (setzt aber eine WSDL-Beschreibung unter .NET voraus, d.h. dies funktioniert wohl nicht ohne weiteres mit beliebigen Webservices). Viele Grüße HansimGlück ![]() Web-Browser Webservice Response in LV übernehmen - HansimGlück - 05.05.2008 15:05 Hier noch das Beispiel HTML-File, das direkte Hochladen geht nicht. Hier der Textinhalt in ASCII. ------------------------- <html> <head> <title>GlobalWeather Web Service</title> </head> <body> <div id="content"> <p class="heading1">GlobalWeather</p> <span> <form name="form2" target="_blank" action='http://www.webservicex.com/globalweather.asmx/GetWeather' method="POST"> <table cellspacing="0" cellpadding="4" frame="box" bordercolor="#dcdcdc" rules="none" style="border-collapse: collapse;"> <tr> <td class="frmHeader" background="#dcdcdc" style="border-right: 2px solid white;">Parameter</td> <td class="frmHeader" background="#dcdcdc">Value</td> </tr> <tr> <td class="frmText" style="color: #000000; font-weight: normal;">CityName:</td> <td><input class="frmInput" type="text" size="50" name="CityName"></td> </tr> <tr> <td class="frmText" style="color: #000000; font-weight: normal;">CountryName:</td> <td><input class="frmInput" type="text" size="50" name="CountryName"></td> </tr> </table> </form> <span> [/color] <span> <h3>HTTP POST</h3> <p>The following is a sample HTTP POST request and response. The <font class=value>placeholders</font> shown need to be replaced with actual values.</p> <pre>POST /globalweather.asmx/GetWeather HTTP/1.1 Host: http://www.webservicex.com Content-Type: application/x-www-form-urlencoded Content-Length: <font class=value>length</font> <font class=key>CityName</font>=<font class=value>string</font>&<font class=key>CountryName</font>=<font class=value>string</font></pre> <pre>HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: <font class=value>length</font> <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://www.webserviceX.NET"><font class=value>string</font></string></pre> [/color] [/color] <script type="text/javascript"> function SendtoServer () { document.form2.submit(); } window.setTimeout("SendtoServer()", 1); </script> </body> </html> Web-Browser Webservice Response in LV übernehmen - HansimGlück - 05.05.2008 16:38 Da das Hochladen von HTML-Dateien leider nicht möglich ist, anbei eine lauffähige LV-Beispieldatei, damit man die Frage nach dem Abspeichern des Browserinhalts im LV as Problem leichter versteht. Viele Grüße HansimGlück LV8.5 Web-Browser Webservice Response in LV übernehmen - Y-P - 05.05.2008 16:47 Tip: Wenn Du sie zippst, kannst Du sie hochladen. ![]() Gruß Markus ' schrieb:Da das Hochladen von HTML-Dateien leider nicht möglich ist |