SSIS with Script task

Asked By Murugan V
28-Jan-10 02:06 AM
Earn up to 0 extra points for answering this tough question.
Hi All,
I have an issue while creating the webrequest.create(url) with the following scenario.

I have deployed the Reports in the report server.
I have created SSIS package which has the script task.
Script task is used for generating the reports and export it to PDF format and stored it in the shared (configured) location.
I have written the VB.NET code to read the report server & report name URL.
When i tried to access the URL through VB.NET code, i'm getting the exception like below

"System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()"

If anyone come across this situation and resolved, please share your thoughts.

Thanks in Advance.

  re: SSIS with Script task

nanda Kishore replied to Murugan V
02-Apr-10 05:22 AM
Try below code

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://Jupiter:8080/Reportserver"); 
request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;

request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Response.Write("Content length is:"+response.ContentLength);
Response.Write("Content type is: "+response.ContentType);
          
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream,System.Text.Encoding.UTF8);                        
Response.Write(readStream.ReadToEnd());
response.Close();
readStream.Close();
Create New Account