Page 1
Page 2
Page 3
Uploading data to the server using
EVB and XML
This article is a continuation of Generating
eVB forms from XML document where I showed you how to
create eMbedded Visual Basic forms from an XML document,
change the values of XML nodes/attributes using textbox,
listbox, etc. and then save the updated XML document in
the device. A few people have asked me after that how to
send the XML document to a remote server so that the XML
parser on the server make use of the XML document. This
article focuses on that sector where we will use the EVB
and MSXML parser to send the XML document to the server
and display the information that was sent from the server
after the successful upload.
First things first
This article is focused on a client-server
based application. We need to setup a few things first in
order to test and debug the code.
- IIS Server with ASP support. Also
the folder where we are going to put the ASP file, execution
permission has to be given to scripts.
- MSXML parser installed in the server.
Usually this comes with Internet Explorer 4.0 and higher
versions.
- TCP/IP connection to connect to
the remote server. Usually you get this connection when
you connect to the local ISP using dialup. Wireless LAN
devices also support this.
The modified XML document
In order to send the XML document to
a URL, you need to specify the URL in the application. We
will put the URL in every XML document so that the XML document
will tell the application where it needs to upload the file.
For this, I have attached a single XML node on every XML
document:
<param id="uploadpath">http://127.0.0.1:8080/shakil/test.asp</param>
This additional node does not effect
the application since there is no action defined in the
"DisplayXMLObject" function and it will
simply ignore this node.
So our newly modified XML document
looks like this:
<?xml version="1.0"?>
<orderform>
<param id="uploadpath">http://127.0.0.1:8080/shakil/test.asp</param>
Name:<input type="text" name="cli_name"
value=""/><br/>
Address:<br/>
<textarea name="cli_address" rows="3"></textarea><br/>
Phone:<input type="text" name="cli_phone"
value=""/><br/>
Pizza:<br/>
<select name="cli_pizza" multiple="true">
<option value="1" selected="true">The
Edge</option>
<option value="2" selected="true">Stuffed
Crust</option>
<option value="3" selected="false">The
Italian</option>
<option value="4" selected="false">Pan
Pizza</option>
</select><br/>
Toppings:<br/>
<select name="cli_topings" multiple="false">
<option value="1" selected="true">Oil,
olives and mushrooms</option>
<option value="2" selected="false">Shredded
veggies topped with a favorite salad dressing</option>
<option value="3" selected="false">Tuna,
onions and veggie oil, salt and pepper</option>
</select><br/>
Delivery:<br/>
<input type="radio" name="cli_delivery"
checked="true"/>Delivery<br/>
<input type="radio" name="cli_delivery"
checked="false"/>Table<br/>
<input type="radio" name="cli_delivery"
checked="false"/>Take Away<br/>
</orderform>
Next Page