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 755629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:09:06+00:00 2026-05-14T15:09:06+00:00

I’m writing my first C# web application that connects to an XML based service.

  • 0

I’m writing my first C# web application that connects to an XML based service. It requires that I present a certificate and feed the XML stream. It seems to authenticate properly but then it gives the following error:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.1.10.4:3128

The funny thing is that I’m not on a proxy or anything like that. I’m connecting directly to the internet. At one point I we did use a proxy that with internal NAT address.

So my question is: Does Visual Studio have some sort of default proxy setting that I need to change? This IP is no longer used for anything, so I know that I don’t need to use any proxy authentication code.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Uri requestURI = new Uri("*site omitted*");

            //Create the Request Object
            HttpWebRequest pageRequest = (HttpWebRequest)WebRequest.Create(requestURI);

            //After installing the cert on the server export a client cert to the working directory as Deluxe.cer
            string certFile = "*certificate omitted*";
            X509Certificate cert = X509Certificate.CreateFromCertFile(certFile);

            //Pull in your Data, if it is from an external xml as below or create an xml string with variables if a dynamic post is required.
            string xmlPath = "*XML omitted*";
            System.Xml.XmlDocument passXML = new System.Xml.XmlDocument();
            passXML.Load(xmlPath);

            //XML String with the data needed to pass
            string postData = passXML.OuterXml;

            //Set the Request Object parameters
            pageRequest.ContentType = "application/x-www-form-urlencoded";
            pageRequest.Method = "POST";
            pageRequest.AllowWriteStreamBuffering = false;
            pageRequest.AllowAutoRedirect = false;
            pageRequest.ClientCertificates.Add(cert);
            postData = "xml_data=" + Server.UrlEncode(postData);
            pageRequest.ContentLength = postData.Length;

            //Create the Post Stream Object
            System.IO.StreamWriter postStream = new System.IO.StreamWriter(pageRequest.GetRequestStream());

            //Write the data to the post stream
            postStream.Write(postData);
            postStream.Flush();
            postStream.Close();

            //Set the Response Object
            HttpWebResponse postResponse = (HttpWebResponse)pageRequest.GetResponse();
  • 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-05-14T15:09:06+00:00Added an answer on May 14, 2026 at 3:09 pm

    The only way you’re going to find out what’s going on is to look at the network traffic with Fiddler or maybe Microsoft Network Monitor.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.