Advertisement

07.15.2008 at 06:04AM PDT, ID: 23565859
[x]
Attachment Details

httpwebrequest on different Port?

Asked by mgordon-spi in Microsoft Visual Basic.Net, Programming Languages, .NET

Tags: VB.Net

Hi All, I have a snippet of code (Attached). I am using the httpwebrequest class to make a web request to an ASPX page that returns XML. Everything is working fine, but I would like to change from the default port of port 80 and cannot work out how to do this. We currently have a web service working on port 8080 that I would like to interface with.

Any Ideas?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
myhttpWebRequest = System.Net.HttpWebRequest.Create(DestinationURL)
 
 
        'myhttpWebRequest.Timeout = -1
        If blnUseSecurity Then
            myhttpWebRequest.Credentials = New System.Net.NetworkCredential(strUsername, strPassword)
        End If
        myhttpWebRequest.PreAuthenticate = True
        myhttpWebRequest.UserAgent = "SOL-1 JasJam"
        myhttpWebRequest.Method = "POST"
        myhttpWebRequest.ContentType = "application/x-www-form-urlencoded"
        myhttpWebRequest.AllowWriteStreamBuffering = True
[+][-]07.15.2008 at 06:28AM PDT, ID: 22006731

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 01:37PM PDT, ID: 22010841

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Programming Languages, .NET
Tags: VB.Net
Sign Up Now!
Solution Provided By: gemailj
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.14.2008 at 04:27AM PDT, ID: 22229197

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628