Go Down

Topic: View XML (Read 1 time) previous topic - next topic

sunnyraven

In the first step to work with the yun I will porting an existing Project with an uno an Ethernet Shield to an yun.

It was an easy way to bring the first lines to the Webbrowser but the xml is not displayed correctly.

I print this lines to the Client:

Code: [Select]
//Daten an Webseite als XML senden
  //client.println(F("HTTP/1.1 200 OK"));
  client.println(F("Content-Type: application/xhtml+xml; charset=ISO-8859-1"));
  client.println(F("Connnection: close"));
  client.println();
   
  // Send XML body.
  client.println(F("<?xml version=\"1.0\"?>"));
  client.println(F("<xml>"));
  client.println(F("<wall24-aquacontrol-01>"));
  client.print(F("<temp>"));
  client.print(TempMittel);
  client.print(F("</temp>"));
  client.println(F("</wall24-aquacontrol-01>"));           
  client.println(F("</xml>"));


with the uno an ethernet the Webbrowser show an request like this:

Quote
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xml>
<wall24-og-log-01>
<temp>21.90</temp>
<hum>58.10</hum>
</wall24-og-log-01>
</xml>


with the yun the request are no correct xml:

Quote
HTTP/1.1 200 OK
Content-Type: application/xhtml+xml; charset=ISO-8859-1
Connnection: close

<?xml version="1.0"?>
<xml>
<wall24-aquacontrol-01>
<temp>-127.00</temp></wall24-aquacontrol-01>
</xml>


Can someone help me where the failure is?

Thank you

federicofissore

One little piece is missing. Replace
Code: [Select]
//client.println(F("HTTP/1.1 200 OK"));
with
Code: [Select]
client.println(F("Status: 200"));

sunnyraven

Strike!! Thats it!

Thank you Federico!

Best Regards
Wolfgang



Go Up