473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HTTP Post Problem in Pocket PC

I posted this question in PocketPC newsgroup with no answer. Hopefully
somebody in this newsgroup can help me.

I have problem with HTTP post in Compact Framework. The code below is
a function I use to post a HTTP message. This code works in Windows XP
always. When I compile the same code to run on an iPaq PocketPC 2003
it works exactly 2 times and then fails afterward at line
"GetResponseStream()" with the exception;
"System.Net.WebException; Could not find resource assembly"
I have tried this code through the ActiveSync USB link and also a
SocketComm compact flash network card on the iPaq with exactly the same
failure after two times working properly. If I quit the application
and run it again it works again for two times and then fails afterward.

I can't figure out why this code works on Windows XP and fails after
exactly two times in an iPaq under Compact Framework. Is there a
resource that is not released in PocketPC? Can failure after 2 times
give a clue what might be wrong? Is there a way to modify the code to
work always? Is there a sample code for proper HTTP Post in PocketPC?
Any help is highly appreciated.
// -----------------------------------------------------
// -----------------------------------------------------
// -- HTTP Post function. Failing line shown ----------
// -----------------------------------------------------
public string HttpPost(string URI, string PostMessage)
{
System.Net.WebResponse resp = null;
try
{
System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
req.ContentType = "text/xml";
req.Method = "POST";
req.Timeout = 2000; // 2 seconds
byte[] bytes =
System.Text.Encoding.ASCII.GetBytes(PostMessage);
req.ContentLength = bytes.Length;
System.IO.Stream os = req.GetRequestStream(); // <-- fails here
after 2 times
os.Write(bytes, 0, bytes.Length);
os.Close();
resp = req.GetResponse();
}
catch (Exception e)
{
string msg = "HTTP Post failed\r\n";
msg += e.ToString();
return msg;
}
if (resp == null) return null;
System.IO.StreamReader sr = new
System.IO.StreamReader(resp.GetResponseStream());
return sr.ReadToEnd().Trim();
}

Dec 13 '05 #1
0 2179

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jimmy | last post by:
Dear All, I have a interesting question, may sound dump. Could I develop a vb6 programs that run under win2000 server terminal services and the program is access by a pocket pc? How could I...
1
by: santhosh_176 | last post by:
:I Created a Pocket PC application for iPAQ 5450. Every thing went fine even installer creation. I could run the setup and install it into the actual device and worked fine. The application enables...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
8
by: Krishnan Margabandhu | last post by:
I'm writing a Pocket PC app that will run when a device is first powered on. I want this program to get some data from the user and invoke a CAB file to install a software on the device. How do I...
1
by: M O J O | last post by:
Hi, I've developed a Windows VB.Net CRM application for my company. I need my own CRM application to be able to replicate it's calendar with my Pocket PC 2003 Outlook calendar. Understand...
10
by: Neil Wallace | last post by:
Guys, I am hopping mad. I am just a hobby programmer making little .net applications for pretty much no-one else but me to use. One application I have written would, to my mind, work best on...
3
by: Daniel Liberman | last post by:
Hi, everyone. That's my environment: - I have a pocket pc (iPAQ h4350) application developed with VSNET2003/C# that has a SQL Server CE Database, running. That's working fine. Obs: the pocket...
0
by: pumaken68 | last post by:
Does anyone has experience with calling web service from pocket pc 2003 project in VS 2005 environment? I just migrated a smart device(pocket pc 2003) solution from VS 2003 to VS 2005. There are...
5
by: Terry Metcalfe | last post by:
I have an Asus A696 pocket PC. I have written a small test program in VB6 called "Pocket PC" and compiled it just as I would normally do to run on my desk top. It runs on my desk top perfectly...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.