Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7852421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:24:50+00:00 2026-06-02T19:24:50+00:00

I am trying to send an XML via web client on Monotouch. Although everything

  • 0

I am trying to send an XML via web client on Monotouch. Although everything is working on the iOS simulator I get an exception when the app is running on the device. Here is the code.

try
{
   Byte[] sendData = System.Text.Encoding.UTF8.GetBytes(someXML) ;
   WebClient client = new WebClient();
   Byte[] forResp;
   client.Headers.Add("Content-Type","text/xml");

   bresp = wc.UploadData(URL, sendData);
   string resp = System.Text.Encoding.ASCII.GetString(forResp);
   XmlDocument xresp = new XmlDocument();
   xresp.LoadXml(resp);
   return xresp;
}
catch
{
    // error
}

I tried the WebClient because I had the same issue with the HttpWebRequest.

Exception:

The request timed out
System.Net.WebException: The request timed out
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00065] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:830 
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:836 
  at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebClient.cs:1433 
  at System.Net.WebClient.ReadAll (System.Net.WebRequest request, System.Object userToken) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebClient.cs:866 
  at System.Net.WebClient.UploadDataCore (System.Uri address, System.String method, System.Byte[] data, System.Object userToken) [0x00038] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebClient.cs:462 
  at System.Net.WebClient.UploadData (System.Uri address, System.String method, System.Byte[] data) [0x00035] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebClient.cs:441 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:24:51+00:00Added an answer on June 2, 2026 at 7:24 pm

    The stacktrace tells us that the timeout occurs when WebClient tries to get a response from the server (and not when uploading the data to the server). That means access to the server is not the issue (and why stacktraces are very useful 😉

    The next steps depends if you have control, or not, of the server. If you control the server then check it’s logs to find the request and see how it was handled. If possible also ensure you received/decoded the data identically between the simulator and device.

    If you do not control the server then it’s harder to know what’s going on inside it. E.g. maybe it did not like the request (i.e. the server code can decide not to answer based on any condition, including the user-agent).

    In such case using a tool, like wireshark, is often your best bet. Compare the session from the iOS simulator and from the device.

    • Is the request identical ? e.g. the data you uploaded could be different due to something else;

    • Is the server answering for the device ? with the same status code ? in the same time frame ?

    If everything is identical then you might have found a bug. Please report it (along with the above informations and files) to http://bugzilla.xamarin.com

    Otherwise you should have more precise clues to debug the issue and/or update the question to be more specific 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send an xml message to a server from a client app
I'm trying to send XML doc to server from client. But when server get
I am trying to send the XML data to a web service. But i
I am trying to send an XML file to my RESTful web server, and
I am trying to SEND to gmail a contact record via XML as suggested
I'm trying to send email via google apps from my asp.net app and am
I am trying to send raw xml to a service in Python. I have
I'm trying to send a very basic XML string from a Windows Phone application
I'm trying to have a console application to send a XML file to a
I'm tired of trying to send a request with SOAP. this is my xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.