I am trying to invoke webservice from
jsp.
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
byte[] b = reqXml.getBytes();
httpConn.setRequestProperty( "Content-Length",
String.valueOf( b.length ) );
httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8");
httpConn.setRequestProperty("SOAPAction",SOAPAction);
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
OutputStream out2 = httpConn.getOutputStream();
out2.write( b );
out2.close();
// Read the response and write it to standard out.
InputStreamReader isr =new InputStreamReader(httpConn.getInputStream());
When it reaches the above line httpConn.getInputStream() it throws the error
java.io.IOException: Server returned HTTP response code: 500 for URL:
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1313)
Due to this,response is not generated and webservice methods are not called.What could be wrong?Please help.
Regards,
Purnima Nair