I'm attempting to test an aspx module that will receive XML data from a web service (the receiver module). I want to be able to test this portion before attempting to create the Web Service that will generate the POST to this module. The "poster module" works fine but when I try to get the response back from the receiver module I get a "(500) Internal Server Error." and the module is never executed. I have added it to the same solution and also attempted as a separate solution on my machine. The path is correct. What am I doing wrong?
poster module:
Thanks for any help.
4 3330 Plater 7,872
Recognized Expert Expert
You use localhost a lot, is the computer that the code is running on really the computer you are trying to talk to?
Is testing this code keeping the section that you wish to talk to from coming up and answering?
A 500 class error usually means whoever you are trying to talk to is having problems.
You also have a duplicate function definition in there (page_load)
Thank you for your reply. They are two different modules and I have marked them as such. One is the poster and the other the receiver. Yes they are in my local machine.
Changed the receiver code and problem solved. This code is also working within the same solution so you can test and debug both modules before puting the receiver on the server. For those that may need this code here it is:
Receiver module: -
-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
-
Call GetResponse()
-
-
End Sub ' Main
-
-
Private Sub GetResponse()
-
-
Try
-
-
Dim mobjStream As Stream
-
Dim strmContents As String
-
Dim counter, strLen, strRead As Integer
-
-
' Create a Stream object.
-
mobjStream = Request.InputStream
-
-
' Find number of bytes in stream.
-
strLen = CInt(mobjStream.Length)
-
-
' Create a byte array.
-
Dim strArr(strLen) As Byte
-
-
' Read stream into byte array.
-
strRead = mobjStream.Read(strArr, 0, strLen)
-
-
' Convert byte array to a text string.
-
For counter = 0 To strLen - 1
-
strmContents = strmContents & strArr(counter).ToString()
-
Next counter
-
-
lblResponseContent.Text = strmContents
-
-
'Return Response to poster.
-
Response.Write("XML RECEIVED")
-
-
Catch ex As Exception
-
-
lblResponseContent.Text = ex.Message
-
-
End Try
-
-
End Sub
-
One more thing, you'll need these imports: -
Imports System
-
Imports System.IO
-
Imports System.Net
-
Imports System.Text
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Satinderpal Singh |
last post by:
Hi everyone,
We are using HttpWebRequest to create a request to a URI, which requires us
to login first. In order to process all the transactions, first we have to
login and get the cookie value in a variable and make the request again with
that cookie as a header value (Digest Authentication).
But, the problem we are facing is: That the...
|
by: Denny Rue |
last post by:
I’ve created VB code to download files from a web site through the use of
HTTPWebRequest, HTTPWebResponse and BinaryReader.
The HTTPWebRequest has a TimeOut property to limit how long it waits for a
corresponding HTTPWebResponse. This works just fine. However, the timeout
does not appear to apply to a BinaryReader created from the...
|
by: Nathan |
last post by:
This is a copy of a message at microsoft.public.dotnet.framework.clr:
THE CODE:
I'm using an HttpWebResponse object to send an HTTP POST to a Java server I have written and are running on the same machine (for dev and testing). Here is the C# code snippet:
1 string clientAddr = "http://127.0.0.1:22225/";
2 try
3 {
4 webreq =...
|
by: Karsten Grombach |
last post by:
Hi,
I'm trying the following:
- Imitate a Logon using a Post with HttpWebRequest on remote Webserver (asp
3.0 page using https)
- On success redirect to the page (encapsuled in an iframe) supplied by the
remote Webserver
I can successfuly logon but when I redirect to the supplied url, the
webserver does not know me anymore an redirects...
|
by: Satinderpal Singh |
last post by:
Hi everyone,
We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value in a variable and make the request again with that cookie as a header value (Digest Authentication).
But, the problem we are facing is: That the...
| |
by: Noggin The Nog |
last post by:
Hi all, I've been trying to get HttpWebResponse to work, but whenever I try I
get "The operation has timed-out". I'm simply trying to send an HTTP request
querystring to a remote website and read back the single string it returns
(OK/Not-Ok)! It seems such a simple thing to do, but I've been on this for
hours now!
Here's the code I'm...
|
by: STEVE.KING |
last post by:
Greetings:
I need to download an executable and some other binary files (a C++
DLL) from a virtual directory in my WinForms application. No-Touch
Deployment manages my .NET code fine but auxilliary files such as these
must be downloaded "manually" in my code. My text-based files download
fine but I've ran into a problem downloading an...
|
by: Howeird |
last post by:
Problem:
I am writting a quick and dirty web link checker for a site that allows
local business to post their web site's URL. I have encountered a probelm
when the reqested URI points to a site that contains a frame loading content
from another domain. Any insight would be welcome.
The Web Page:
I try to hit a url (see code below) say...
|
by: daz_oldham |
last post by:
Hi
I have a method (very bottom of this post) which I am using for doing
XMLRPC calls.
This works fine locally in Cassini (debug mode in VS2005, WinXP SP2),
however when I run this on my production server (MS Win 2k) I am
getting the following socket error:
System.Net.Sockets.SocketException: No connection could be made because
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |