PDA communication

  • Thread starter Thread starter jayderk
  • Start date Start date
J

jayderk

Hello All,

I wrote an application for WM 2003 devices.


My problem is this.
I have 3 devices to work with, the one I was developing on is a few months
older then the two we are going to have our customers test with. The only
difference is the new devices have Qwerty keyboards. On the new Qwerty
device it looks like my web request is not sending any data to the server..
I attached a network sniffer to it and found that it sent the keep-alive
thread, then sent nooo data in the payload.. the server log shows that a
payload of nothing was sent.. at that point of course the server complained
and returned an error to me.

I have been using my WebRequest class on many project over the last 2.5
years and has been working flawless.

info: this app workes perfectly on the non-Qwerty device with both wireless
communication and over ActiveSync. It also works perfectly on a windows CE
4.1 unit we have with both wireless communication and over ActiveSync? this
is very puzzling?
 
jayderk,

Let me admit right up front that I don't know what's causing the problem
you're seeing. But if the devices with the keyboards are Windows Mobile 2003
Second Edition and all the other devices that don't have the problem are
not, that might be the explanation.
 
Thank you for the quick response.

I have a Symbol MC50 device with a Qwerty keyboard and a MC50 with a
NON-Qwerty keyboard.
they are the exact same build.

regards,
Jay
 
Jay,

That is indeed odd. Is it possible that might be a hardware issue with the
one device that isn't working? I think I'd want to try another MC50 with the
keyboard (if you haven't already done so) to rule out that possiblity. Since
your app has been working so well for so long on so many devices, it seems
unlikely there's any problem there.
 
Here is the code I have been using for the last couple years.

are there any communication files that I could maybe copy over from one
device to the other?


code that works on EVERY other device accept the Qwerty keyboard MC50.



public static Stream getXmlStream(string requestXml, string servlet, string
timeOut)
{
string server = "EMPTY";
if(File.Exists(@"\Windows\RoutelinkURL.txt"))
{
FileStream rlFile = File.Open(@"\Windows\RoutelinkURL.txt", FileMode.Open,
FileAccess.Read, FileShare.Read);

StreamReader sr = new StreamReader(rlFile);
string temp = sr.ReadLine();
if(temp != null || temp.Trim().Length != 0)
server = temp;

rlFile.Close();
sr.Close();
}

if(!server.Trim().Equals("EMPTY"))
{
//server address found
server += servlet;
}
else
server = decoderUrl + servlet;

//Library.CfDebugger.WriteDebugLine("server URL:" + server);
WebRequest req = null;
try
{
req = WebRequest.Create(server);
req.Method = "POST";
req.ContentType = "text/plain; charset=utf-8";
byte[] encodedBytes = Encoding.UTF8.GetBytes(requestXml);
req.ContentLength = encodedBytes.Length;
if(timeOut.Length > 1)
req.Timeout = int.Parse(timeOut);

Stream reqStream = req.GetRequestStream();
reqStream.Write(encodedBytes, 0, encodedBytes.Length);
reqStream.Close();

WebResponse result = req.GetResponse();
return (Stream)result.GetResponseStream();
if(req != null)
req = null;
}
catch(Exception exce)
{
if(req != null)
req = null;

throw new Exception("Error Communicating with server, please try again");
}
 
Jay,

I think I"d ask Symbol at this point if they have any idea why you're having
this problem on that one model.

--
Ginny Caughey
..Net Compact Framework MVP


jayderk said:
Here is the code I have been using for the last couple years.

are there any communication files that I could maybe copy over from one
device to the other?


code that works on EVERY other device accept the Qwerty keyboard MC50.



public static Stream getXmlStream(string requestXml, string servlet,
string
timeOut)
{
string server = "EMPTY";
if(File.Exists(@"\Windows\RoutelinkURL.txt"))
{
FileStream rlFile = File.Open(@"\Windows\RoutelinkURL.txt",
FileMode.Open,
FileAccess.Read, FileShare.Read);

StreamReader sr = new StreamReader(rlFile);
string temp = sr.ReadLine();
if(temp != null || temp.Trim().Length != 0)
server = temp;

rlFile.Close();
sr.Close();
}

if(!server.Trim().Equals("EMPTY"))
{
//server address found
server += servlet;
}
else
server = decoderUrl + servlet;

//Library.CfDebugger.WriteDebugLine("server URL:" + server);
WebRequest req = null;
try
{
req = WebRequest.Create(server);
req.Method = "POST";
req.ContentType = "text/plain; charset=utf-8";
byte[] encodedBytes = Encoding.UTF8.GetBytes(requestXml);
req.ContentLength = encodedBytes.Length;
if(timeOut.Length > 1)
req.Timeout = int.Parse(timeOut);

Stream reqStream = req.GetRequestStream();
reqStream.Write(encodedBytes, 0, encodedBytes.Length);
reqStream.Close();

WebResponse result = req.GetResponse();
return (Stream)result.GetResponseStream();
if(req != null)
req = null;
}
catch(Exception exce)
{
if(req != null)
req = null;

throw new Exception("Error Communicating with server, please try again");
}












Ginny Caughey said:
jayderk,

Let me admit right up front that I don't know what's causing the problem
you're seeing. But if the devices with the keyboards are Windows Mobile 2003
Second Edition and all the other devices that don't have the problem are
not, that might be the explanation.
 
Back
Top