• Post Reply Bookmark Topic Watch Topic
  • New Topic

urlconnection to IIS (.NET)... 500 Error  RSS feed

 
Java Dev
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help...
I am running both server on a same local computer.
I have sample java app on iPlanet. Servlet connects to .NET app in IIS (same local machine) using URLConnection. I use following syntax to send a sample html.
URLConnection con = destUrl.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
PrintWriter out = new PrintWriter(con.getOutputStream());
out.println("<html><body>DotNetConnectionTest</body></html>");
out.close();
.NET app receives the incoming request stream (Request.InputStream) and return "<html><body>Successful</body></html>" as a Response.
If I do not send any inputstream, both app works fine. But When I send the PrintWriter to the .NET app, I get java exception
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:80/DotNetConnection/DotNetConnect.aspx at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:604) at DotNetConnection.doPost(DotNetConnection.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:897) at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:464)
Can anyone help?
Thank you.
Ps. I tried using "ServicePointManager.DefaultConnectionLimit = 2;" in .NET, but didn't work....
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
May I ask you to take a minute for editing your display name so that it complies with our naming policy (a real, or real-looking name required)?
Thanks.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTTP 500 error you're getting from the .NET-side indicates that there was an internal error of some sort. Without knowing much about ASP.NET (I assume .aspx implies the use of ASP.NET), my suggestion would be to check the IIS logs for error messages and instrument your ASP.NET page with logging statements.
Oh, (again without much knowledge of ASP.NET) is your .aspx page configured to accept HTTP POST requests?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!