Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
GeneralDynamically create COM objects in C# Pin
raymondlee19-Jul-05 6:12
raymondlee19-Jul-05 6:12 
GeneralVisual inheritance problem Pin
Member 164882919-Jul-05 5:35
Member 164882919-Jul-05 5:35 
GeneralRe: Visual inheritance problem Pin
Christian Graus19-Jul-05 10:56
protectorChristian Graus19-Jul-05 10:56 
GeneralRe: Visual inheritance problem Pin
Dan Neely19-Jul-05 11:06
Dan Neely19-Jul-05 11:06 
GeneralRe: Visual inheritance problem Pin
Christian Graus19-Jul-05 11:10
protectorChristian Graus19-Jul-05 11:10 
GeneralAlphanumeric counter Pin
Zeppelin2519-Jul-05 5:12
Zeppelin2519-Jul-05 5:12 
GeneralRe: Alphanumeric counter Pin
Christian Graus19-Jul-05 10:57
protectorChristian Graus19-Jul-05 10:57 
Generalwebrequest problem Pin
cakewalkr719-Jul-05 4:59
cakewalkr719-Jul-05 4:59 
I'm trying to post a string of xml to another site and I've set up a test script on my own machine to recieve and parse the xml and return a value. When I run that page by itself and feed it some xml, it works fine. But, when I try to call it with the webrequest object, I get an internal server error. Can anyone see what I'm doing wrong here? I've never used this class before so I'm not really sure if I'm doing everything I'm supposed to. Thanks. Oh, and it errors on the line that says WebResponse myWebResponse = myRequest.GetResponse();


HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost/test.asp");

myRequest.Method="POST";

myRequest.ContentType = "application/x-www-form-urlencoded";

ASCIIEncoding encoder = new ASCIIEncoding();

// Convert the string into a byte array.

byte[] xmlBytes = encoder.GetBytes("xmlData="+xDoc.InnerXml);

myRequest.ContentLength = xmlBytes.Length;

Stream newStream=myRequest.GetRequestStream();

newStream.Write(xmlBytes,0,xmlBytes.Length);

newStream.Close();

// Return the response.

WebResponse myWebResponse = myRequest.GetResponse();

// Obtain a 'Stream' object associated with the response object.

Stream ReceiveStream = myWebResponse.GetResponseStream();

Encoding encode = System.Text.Encoding.GetEncoding("utf-8");

// Pipe the stream to a higher level stream reader with the required encoding format.

StreamReader readStream = new StreamReader( ReceiveStream, encode );

response = readStream.ReadToEnd();

readStream.Close(); readStream = null;

myWebResponse.Close();


GeneralRe: webrequest problem Pin
cakewalkr719-Jul-05 5:55
cakewalkr719-Jul-05 5:55 
Questionhow to raise sql messages in c# Pin
fady_sayegh19-Jul-05 4:58
fady_sayegh19-Jul-05 4:58 
AnswerRe: how to raise sql messages in c# Pin
Not Active19-Jul-05 5:57
mentorNot Active19-Jul-05 5:57 
GeneralExcel automation Pin
Christer Claesson19-Jul-05 4:37
Christer Claesson19-Jul-05 4:37 
GeneralProblem with a dynamically loaded DLL Pin
chrismetcalf19-Jul-05 4:00
chrismetcalf19-Jul-05 4:00 
GeneralCOM Events with C# Pin
skai00719-Jul-05 3:31
skai00719-Jul-05 3:31 
GeneralControl Level Transparency Pin
Jaswinder Singh Kohli19-Jul-05 3:12
sussJaswinder Singh Kohli19-Jul-05 3:12 
GeneralRe: Control Level Transparency Pin
Roger Alsing19-Jul-05 3:35
Roger Alsing19-Jul-05 3:35 
GeneralUpdate Row Pin
zaboboa19-Jul-05 2:53
zaboboa19-Jul-05 2:53 
GeneralRe: Update Row Pin
Luis Alonso Ramos19-Jul-05 17:38
Luis Alonso Ramos19-Jul-05 17:38 
Generalcreating transparent window problem Pin
Member 161799919-Jul-05 2:42
Member 161799919-Jul-05 2:42 
GeneralRe: creating transparent window problem Pin
User 665819-Jul-05 4:40
User 665819-Jul-05 4:40 
GeneralRe: creating transparent window problem Pin
Member 161799919-Jul-05 4:47
Member 161799919-Jul-05 4:47 
GeneralThreads Pin
deeps2619-Jul-05 2:39
deeps2619-Jul-05 2:39 
GeneralRe: Threads Pin
maheswara19-Jul-05 2:57
maheswara19-Jul-05 2:57 
GeneralRe: Threads Pin
S. Senthil Kumar19-Jul-05 7:01
S. Senthil Kumar19-Jul-05 7:01 
Questionfill listview in different class and file? Pin
oleman10819-Jul-05 2:18
oleman10819-Jul-05 2:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.