EmbeddedRelated.com
Forums

Maximum xml Data Size: RCM4300 DC10-72

Started by "mjm...@gmail.com [rabbit-semi]" February 19, 2016
Good day,

I would like to know what the size limitation for sending xml data is?
I'm using XMLHttpRequest() to request the xml file.
I have been through the documentation and can't seem to find any (MACROS) settings for this?

I can successfully send a small number of characters in xml.
But when I examine the packet sent (using Fiddler) from the RCM4300 I find that the data in the xml file is truncated if I go above 256bytes.

I'm using the RCM4300 in a web server application.
Ideally I would like to send up to 30kbytes at a time. This is being used in a data logging application.

Below is the webpage code that requests the xml file:

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
myFunction(xmlhttp);
}
};
xmlhttp.open("GET", "my_data1.xml", true); // true= asynchronous.
xmlhttp.setRequestHeader("Content-Type", "text/xml");
xmlhttp.send(null);

Thanks in advance.
Mike
Mike,

What are you using to provide the "my_data1.xml" content from the Rabbit? You should be able to test with a direct request first to make sure the Rabbit can send the 30K XML file. What happens if you request "my_data1.xml" in the address bar of your browser? Does the entire file come through? Troubleshoot that first, and then work on the XMLHttpRequest() Javascript call.

If you're using the cgi interface from HTTP.LIB, I believe you send individual chunks of the content, and use a specific return code indicating that there's more data to send. If you share your Rabbit code, we should be able to help you with the necessary changes.

-Tom
On Feb 19, 2016, at 3:10 AM, m...@gmail.com [rabbit-semi] wrote:
> Good day,
>
> I would like to know what the size limitation for sending xml data is?
> I'm using XMLHttpRequest() to request the xml file.
> I have been through the documentation and can't seem to find any (MACROS) settings for this?
>
> I can successfully send a small number of characters in xml.
> But when I examine the packet sent (using Fiddler) from the RCM4300 I find that the data in the xml file is truncated if I go above 256bytes.
>
> I'm using the RCM4300 in a web server application.
> Ideally I would like to send up to 30kbytes at a time. This is being used in a data logging application.
>
> Below is the webpage code that requests the xml file:
>
> var xmlhttp = new XMLHttpRequest();
> xmlhttp.onreadystatechange = function() {
> if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
> myFunction(xmlhttp);
> }
> };
> xmlhttp.open("GET", "my_data1.xml", true); // true= asynchronous.
> xmlhttp.setRequestHeader("Content-Type", "text/xml");
> xmlhttp.send(null);
>
> Thanks in advance.
> Mike
> Posted by: m...@gmail.com
Hi Tom,

I have created an array, filled the array with test data.

This same array is declared in the xml file.

To simplify matters I wrote a skeleton program that only has 2 arrays and 2
associated different xml files.

I did as you suggested by directly accessing the xml files from the browser.

At first I was getting xml file read error messages (see screenshots), then
I discovered if I made the array size smaller then the xml data could read
correctly.

The point at which this happens is when the array size is "578" (correct xml
file read) and "579" (xml file read errors).

So any size above 579 would cause read errors, but the error message also
changed with the array size used.

I then changed this "#define HTTP_MAXBUFFER 4096" from 1024.

After that I could read array sizes up to 2k.

Above 2k the compiler generates error message: " line 869 : ERROR IP.LIB
: Out of variable data space. Please refer to the Dynamic C User's Manual
for more information."

I am currently trying put the arrays into "far" memory: far char
logdata1[lenArray]={0};

Is there more that I have specify to move the arrays to far mem?

Because the problem now is with xml data again, I'm getting "garbage" if I
do a direct xml file read.

Are there specific requirements when using far data in the xml file?

Thanks,

Mike

From: r... [mailto:r...]
Sent: Friday, February 19, 2016 8:10 PM
To: r...
Subject: Re: [rabbit-semi] Maximum xml Data Size: RCM4300 DC10-72

Mike,

What are you using to provide the "my_data1.xml" content from the Rabbit?
You should be able to test with a direct request first to make sure the
Rabbit can send the 30K XML file. What happens if you request
"my_data1.xml" in the address bar of your browser? Does the entire file
come through? Troubleshoot that first, and then work on the
XMLHttpRequest() Javascript call.

If you're using the cgi interface from HTTP.LIB, I believe you send
individual chunks of the content, and use a specific return code indicating
that there's more data to send. If you share your Rabbit code, we should be
able to help you with the necessary changes.

-Tom

On Feb 19, 2016, at 3:10 AM, m...@gmail.com [rabbit-semi] wrote:

Good day,

I would like to know what the size limitation for sending xml data is?
I'm using XMLHttpRequest() to request the xml file.
I have been through the documentation and can't seem to find any (MACROS)
settings for this?

I can successfully send a small number of characters in xml.
But when I examine the packet sent (using Fiddler) from the RCM4300 I find
that the data in the xml file is truncated if I go above 256bytes.

I'm using the RCM4300 in a web server application.
Ideally I would like to send up to 30kbytes at a time. This is being used in
a data logging application.

Below is the webpage code that requests the xml file:

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
myFunction(xmlhttp);
}
};
xmlhttp.open("GET", "my_data1.xml", true); // trueasynchronous.
xmlhttp.setRequestHeader("Content-Type", "text/xml");
xmlhttp.send(null);

Thanks in advance.
Mike
_____
Posted by: m...@gmail.com
Mike,

If you can share some code, that will help with guiding you.

First off, a quirk of Dynamic C is that it doesn't support arrays of over 32KB in size, but the compiler won't warn you about that.

It also isn't efficient to keep an XML version of your test data, just so you can send it to web requests. My recommendation would be to keep your logged data and make use of the HTTP server's CGI interface for sending data across multiple function calls.

The "cgi_concurrent.c" sample is overly complex, but demonstrates the interface and how you track the state of the CGI call so you can fill in part of the outbound buffer with data on each call to the function. You might also be able to look up information on the CGI interface in the Rabbit TCP/IP manuals on Digi's website.

If you have trouble understanding it, I can probably help out as well. Put together a simple program sample that sets up the HTTP server, and has a far array of test data. Email it to me off list and I'll flesh out some code to dump the readings as XML.

-Tom
On Feb 20, 2016, at 12:25 AM, 'Mike Moyes' m...@femtodesigns.com [rabbit-semi] wrote:

> Hi Tom,
>
> I have created an array, filled the array with test data.
>
> This same array is declared in the xml file.
>
>
>
> To simplify matters I wrote a skeleton program that only has 2 arrays and 2 associated different xml files.
>
> I did as you suggested by directly accessing the xml files from the browser.
>
> At first I was getting xml file read error messages (see screenshots), then I discovered if I made the array size smaller then the xml data could read correctly.
>
> The point at which this happens is when the array size is 578 (correct xml file read) and 579 (xml file read errors).
>
> So any size above 579 would cause read errors, but the error message also changed with the array size used.
>
>
>
> I then changed this #define HTTP_MAXBUFFER 4096 from 1024.
>
> After that I could read array sizes up to 2k.
>
> Above 2k the compiler generates error message: line 869 : ERROR IP.LIB : Out of variable data space. Please refer to the Dynamic C User's Manual for more information.
>
>
>
> I am currently trying put the arrays into far memory: far char logdata1[lenArray]={0};
>
> Is there more that I have specify to move the arrays to far mem?
>
> Because the problem now is with xml data again, Im getting garbage if I do a direct xml file read.
>
> Are there specific requirements when using far data in the xml file?
>
>
>
> Thanks,
>
> Mike
>