|
-
May 29th, 2006, 02:03 AM
#1
webexception
In my project I have to make a request to some service and process the response. Now I have the working code in Java
[java]
URL url = new URL(link);
InputStream in = url.openStream();
Reader r = new InputStreamReader(in);
...
[/java]
And I wrote in C# like this
[c#]
WebRequest myWebRequest = WebRequest.Create(link);
WebResponse myWebResponse = myWebRequest.GetResponse();
StreamReader sr = new StreamReader(myWebResponse.GetResponseStream();
[/c#]
The java code works fine but c# throws {"The remote server returned an error: (500) Internal Server Error."} at 3rd line FOR THE SAME LINK!!!
What can be a problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|