473,796 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with url on http post

Hi:

I have the following code:

Dim url As String = "http://xx01xx01:800/some.ashx"
Dim myrequest As System.Net.WebR equest = Nothing
Dim myresponse As System.Net.WebR esponse = Nothing
'Prepare web request
myrequest = System.Net.WebR equest.Create(u rl)
'use POST
myrequest.Metho d = "POST"
'Set the content type
Request.Content Type = "applicatio n/x-www-form-urlencoded"
Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
'Get length of content
myrequest.Conte ntLength = byteArray.Lengt h
'Get request stream
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream
'Send the data.
newStream.Write (byteArray, 0, byteArray.Lengt h)
' Close stream
newStream.Close ()
'Send the Post request and wait for the response.
myresponse = myrequest.GetRe sponse()

If I use for the first line something like this:
Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a url
address like this?
Thanks,
Cindy
Jun 27 '08 #1
6 994
On May 19, 10:18*am, "CindyH" <chensc...@new. rr.comwrote:
Hi:

I have the following code:

* * * * * Dim url As String = "http://xx01xx01:800/some.ashx"
* * * * * Dim myrequest As System.Net.WebR equest = Nothing
* * * * * Dim myresponse As System.Net.WebR esponse = Nothing
* * * * * * * 'Prepare web request
* * * * * * * myrequest = System.Net.WebR equest.Create(u rl)
* * * * * * * 'use POST
* * * * * * * myrequest.Metho d = "POST"
* * * * * * * 'Set the content type
* * * * * * * Request.Content Type = "applicatio n/x-www-form-urlencoded"
* * * * * * * Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
* * * * * * * 'Get length of content
* * * * * * * myrequest.Conte ntLength = byteArray.Lengt h
* * * * * * * 'Get request stream
* * * * * * * Dim newStream As System.IO.Strea m = myrequest.GetRe questStream
* * * * * * * 'Send the data.
* * * * * * * newStream.Write (byteArray, 0, byteArray.Lengt h)
* * * * * * * ' Close stream
* * * * * * * newStream.Close ()
* * * * * * * 'Send the Post request and wait for the response.
* * * * * * * myresponse = myrequest.GetRe sponse()

If I use for the first line something like this:
*Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
*Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a url
address like this?
Thanks,
Cindy
From the machine that is running the code, are you able to Ping or
Tracert to the actual FQDN? Is port 800 open on the remote server or
is a firewall blocking this port? Are you able to telnet to the
address including the port?

Larry
Jun 27 '08 #2
On 19 Mayıs, 18:18, "CindyH" <chensc...@new. rr.comwrote:
Hi:

I have the following code:

* * * * * Dim url As String = "http://xx01xx01:800/some.ashx"
* * * * * Dim myrequest As System.Net.WebR equest = Nothing
* * * * * Dim myresponse As System.Net.WebR esponse = Nothing
* * * * * * * 'Prepare web request
* * * * * * * myrequest = System.Net.WebR equest.Create(u rl)
* * * * * * * 'use POST
* * * * * * * myrequest.Metho d = "POST"
* * * * * * * 'Set the content type
* * * * * * * Request.Content Type = "applicatio n/x-www-form-urlencoded"
* * * * * * * Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
* * * * * * * 'Get length of content
* * * * * * * myrequest.Conte ntLength = byteArray.Lengt h
* * * * * * * 'Get request stream
* * * * * * * Dim newStream As System.IO.Strea m = myrequest.GetRe questStream
* * * * * * * 'Send the data.
* * * * * * * newStream.Write (byteArray, 0, byteArray.Lengt h)
* * * * * * * ' Close stream
* * * * * * * newStream.Close ()
* * * * * * * 'Send the Post request and wait for the response.
* * * * * * * myresponse = myrequest.GetRe sponse()

If I use for the first line something like this:
*Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
*Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a url
address like this?
Thanks,
Cindy
Hi,
Are you sure that you want to connect remote host using port 800
instead of 80? Http uses 80 by default.

And make sure url is valid and healty of course.(xx01x01 doesn't make
sense as a valid http domain without com or net or org... extension
alone)

Thanks,

Onur
Jun 27 '08 #3
The guy gave me the wrong url address.
Now I'm able to send the post, but response is empty and getting this error:
system.net.webe xception: The remote server returned an error: (500) Internal
Server Error.
Would this be my problem or his?
Thanks,
Cindy

"CindyH" <ch*******@new. rr.comwrote in message
news:uf******** ******@TK2MSFTN GP06.phx.gbl...
Hi:

I have the following code:

Dim url As String = "http://xx01xx01:800/some.ashx"
Dim myrequest As System.Net.WebR equest = Nothing
Dim myresponse As System.Net.WebR esponse = Nothing
'Prepare web request
myrequest = System.Net.WebR equest.Create(u rl)
'use POST
myrequest.Metho d = "POST"
'Set the content type
Request.Content Type = "applicatio n/x-www-form-urlencoded"
Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
'Get length of content
myrequest.Conte ntLength = byteArray.Lengt h
'Get request stream
Dim newStream As System.IO.Strea m =
myrequest.GetRe questStream
'Send the data.
newStream.Write (byteArray, 0, byteArray.Lengt h)
' Close stream
newStream.Close ()
'Send the Post request and wait for the response.
myresponse = myrequest.GetRe sponse()

If I use for the first line something like this:
Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a
url address like this?
Thanks,
Cindy


Jun 27 '08 #4
On May 19, 10:41*am, "CindyH" <chensc...@new. rr.comwrote:
The guy gave me the wrong url address.
Now I'm able to send the post, but response is empty and getting this error:
system.net.webe xception: The remote server returned an error: (500) Internal
Server Error.
Would this be my problem or his?
Thanks,
Cindy

"CindyH" <chensc...@new. rr.comwrote in message

news:uf******** ******@TK2MSFTN GP06.phx.gbl...
Hi:
I have the following code:
* * * * *Dim url As String = "http://xx01xx01:800/some.ashx"
* * * * *Dim myrequest As System.Net.WebR equest = Nothing
* * * * *Dim myresponse As System.Net.WebR esponse = Nothing
* * * * * * *'Prepare web request
* * * * * * *myrequest = System.Net.WebR equest.Create(u rl)
* * * * * * *'use POST
* * * * * * *myrequest.Meth od = "POST"
* * * * * * *'Set the content type
* * * * * * *Request.Conten tType = "applicatio n/x-www-form-urlencoded"
* * * * * * *Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
* * * * * * *'Get length of content
* * * * * * *myrequest.Cont entLength = byteArray.Lengt h
* * * * * * *'Get request stream
* * * * * * *Dim newStream As System.IO.Strea m =
myrequest.GetRe questStream
* * * * * * *'Send the data.
* * * * * * *newStream.Writ e(byteArray, 0, byteArray.Lengt h)
* * * * * * *' Close stream
* * * * * * *newStream.Clos e()
* * * * * * *'Send the Post request and wait for the response.
* * * * * * *myresponse = myrequest.GetRe sponse()
If I use for the first line something like this:
Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a
url address like this?
Thanks,
Cindy- Hide quoted text -

- Show quoted text -
Normally you can get the exact 500 error when going to the URL
directly via a web browser. This will give you a better idea of what
the 500 internal error message is.

Larry
Jun 27 '08 #5

"kimiraikko nen" <ki************ *@gmail.comschr eef in bericht
news:2f******** *************** ***********@m73 g2000hsh.google groups.com...
On 19 Mayıs, 18:18, "CindyH" <chensc...@new. rr.comwrote:
Hi:

I have the following code:

Dim url As String = "http://xx01xx01:800/some.ashx"
Dim myrequest As System.Net.WebR equest = Nothing
Dim myresponse As System.Net.WebR esponse = Nothing
'Prepare web request
myrequest = System.Net.WebR equest.Create(u rl)
'use POST
myrequest.Metho d = "POST"
'Set the content type
Request.Content Type = "applicatio n/x-www-form-urlencoded"
Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
'Get length of content
myrequest.Conte ntLength = byteArray.Lengt h
'Get request stream
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream
'Send the data.
newStream.Write (byteArray, 0, byteArray.Lengt h)
' Close stream
newStream.Close ()
'Send the Post request and wait for the response.
myresponse = myrequest.GetRe sponse()

If I use for the first line something like this:
Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a
url
address like this?
Thanks,
Cindy
Hi,
Are you sure that you want to connect remote host using port 800
instead of 80? Http uses 80 by default.

And make sure url is valid and healty of course.(xx01x01 doesn't make
sense as a valid http domain without com or net or org... extension
alone)

Thanks,

Onur
Http uses 80 by default
normally 8080 is also open in the firewall because of corporate proxy
servers
Michel .


Jun 27 '08 #6
On May 19, 10:12*pm, "Michel Posseth [MCP]" <M...@posseth.c omwrote:
"kimiraikko nen" <kimiraikkone.. .@gmail.comschr eef in berichtnews:2f* *************** *************** ***@m73g2000hsh .googlegroups.c om...
On 19 Mayıs, 18:18, "CindyH" <chensc...@new. rr.comwrote:


Hi:
I have the following code:
Dim url As String = "http://xx01xx01:800/some.ashx"
Dim myrequest As System.Net.WebR equest = Nothing
Dim myresponse As System.Net.WebR esponse = Nothing
'Prepare web request
myrequest = System.Net.WebR equest.Create(u rl)
'use POST
myrequest.Metho d = "POST"
'Set the content type
Request.Content Type = "applicatio n/x-www-form-urlencoded"
Dim byteArray As Byte() =
System.Text.Enc oding.UTF8.GetB ytes(dataToPost )
'Get length of content
myrequest.Conte ntLength = byteArray.Lengt h
'Get request stream
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream
'Send the data.
newStream.Write (byteArray, 0, byteArray.Lengt h)
' Close stream
newStream.Close ()
'Send the Post request and wait for the response.
myresponse = myrequest.GetRe sponse()
If I use for the first line something like this:
Dim url As String = "http://www.someplace.c om/somepage.aspx" then
everything works fine, but now I need to use the real address which is
something like this: "http://xx01xx01:800/some.ashx"
When the code hits the line:
Dim newStream As System.IO.Strea m = myrequest.GetRe questStream - I'm
getting the following error:
system.net.webe xception: The remote name could not be resolved: 'xx01xx01'
Does anyone have any ideas why I'm having problems with the stream for a
url
address like this?
Thanks,
Cindy

Hi,
Are you sure that you want to connect remote host using port 800
instead of 80? Http uses 80 by default.

And make sure url is valid and healty of course.(xx01x01 doesn't make
sense as a valid http domain without com or net or org... extension
alone)

Thanks,

Onur
Http uses 80 by default

normally 8080 is also open in the firewall because of corporate proxy
servers

Michel .- Hide quoted text -

- Show quoted text -
Yes, but IE and most of browsers assume port 80 to connect the remote
host unless you specify other port like 8080 or another.

"http://www.google.com" works and "http://www.google.com: 80" works
also.

Thanks,

Onur Güzel
Jun 27 '08 #7

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

Similar topics

0
2048
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since the thread is over a month old, I decided to start a new one with my response. Please see my comments inline.
7
2310
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site. The only reason I know that is happening is because I keep track of the pages executed by the user to see how they have traversed the site. Has anyone every seen anything like this before? Regards, Aaron Prohaska
8
1870
by: Bob Skutnick | last post by:
Greetings, I'm hoping someone has experienced a problem I'm having: I have an existing ASP application (working fine) that uses an SSL server certificate. My user community is made up of both PC's and Macintosh computers. I've re-written this application in ASP.NET for a number of reasons and now find that my Mac users are having problems with the application. SSL works just fine for PC
5
3029
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The payment server then returns to my server with the
6
3815
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
1
1958
by: gerry | last post by:
Hi, although this is not strictly asp.net related, I was hoping that someone could confirm or debunk what appears to be a major problem with safari POSTs. with the following html : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <HTML> <HEAD>
43
2178
by: balakrishnan.dinesh | last post by:
Hi all, Im working in javascript, I want to use Ajax in javcascript, Can u tel me how to use ajax in javascript, whether i have to include any code as like to include *css or *.js file, what are all the benefit of it? Thank U
3
9586
by: Jon L | last post by:
Hi, I'm hoping someone can help me with this problem. I'm not sure whether the problem lies with the software or with my understanding of the language. I'm using the Microsoft.XMLDOM object in an ASP page to read an incoming XML post request and respond to it. Although the XMLDOM object verifies the XML at a basic level, I want to make sure that the request is in the correct format (as per the specification I have to
7
2457
by: Inny | last post by:
Hello again, Im using the code below in a child page (popup), the images are called from the parent page. When the changer is running, the child page goes white between images. I realise this is happening because the Images are not cached (yet) on the users browser. I tried preloading images with the 2nd code below in the childpage head and in the parent page head and both. no joy, dosent seem to actually 'preload' the pics. (i also gave...
4
2237
by: CindyH | last post by:
Hi: I have the following code: Dim url As String = "http://xx01xx01:800/some.ashx" Dim myrequest As System.Net.WebRequest = Nothing Dim myresponse As System.Net.WebResponse = Nothing 'Prepare web request myrequest = System.Net.WebRequest.Create(url) 'use POST
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.