Saturday, March 24, 2012
System.Net.WebException: The request failed with the error message:Object moved to he
This question is related to Microsoft Reporting Services Web service. I
tried asking it in RS groups but no one seems to be knowledgeable enough to
answer, so I wanted to try my chances here. Thanks...
I am trying to get the code below to work with no success, I googled the
issue but docs popped up provided little help. Basically I am trying to
create a directory in RS that uses Forms authentication. Everything works on
the Forms authentication side, but it looks like the cookie created using
the web service somehow does not satisfy RS and it tries to redirect to the
logon page.
Could you point me with a document or just provide me with a working sample?
I already tried Teo Lachev's example with no luck.
Thanks,
Skep...
PS: Both web application and the RS are on the same server.
ReportingService rs = new ReportingService();
ReportServerProxy server = new ReportServerProxy();
// Get the server URL from the Report Manager configuration file
server.Url = AuthenticationUtilities.GetWebServiceUrl();
bool passwordVerified = false;
try
{
server.LogonUser("user","password", null);
passwordVerified = true;
}
catch(System.Web.Services.Protocols.SoapException)
{
Message.Text = "Login Error, please try again";
return;
}
// Create a custom property for the folder.
Property newProp = new Property();
newProp.Name = "Department";
newProp.Value = "Finance";
Property[] props = new Property[1];
props[0] = newProp;
string folderName = "Budget";
try
{
rs.CreateFolder(folderName, "/", props );
Label2.Text="Folder created: "+ folderName;
}
catch(Exception ex)
{
Message.Text=ex.ToString();
}Hi Skeptical:
How is the LogonUser call itself authenticated? Do you have anon
access for that call?
I suspect you need to create a CookieContainer object and assign the
instance to the Cookie property of the SSRS proxy class. The
CookieContainer will accept the Set-Cookie header from SSRS and pass
the cookie along on subsequest requests.
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 19 May 2005 15:58:56 -0500, "Skeptical" <skep@.nowhere.com>
wrote:
>Greetings,
>This question is related to Microsoft Reporting Services Web service. I
>tried asking it in RS groups but no one seems to be knowledgeable enough to
>answer, so I wanted to try my chances here. Thanks...
>
>I am trying to get the code below to work with no success, I googled the
>issue but docs popped up provided little help. Basically I am trying to
>create a directory in RS that uses Forms authentication. Everything works o
n
>the Forms authentication side, but it looks like the cookie created using
>the web service somehow does not satisfy RS and it tries to redirect to the
>logon page.
>Could you point me with a document or just provide me with a working sample
?
>I already tried Teo Lachev's example with no luck.
>Thanks,
>Skep...
>PS: Both web application and the RS are on the same server.
>
>ReportingService rs = new ReportingService();
>ReportServerProxy server = new ReportServerProxy();
>// Get the server URL from the Report Manager configuration file
>server.Url = AuthenticationUtilities.GetWebServiceUrl();
>bool passwordVerified = false;
>try
>{
>server.LogonUser("user","password", null);
>passwordVerified = true;
>}
>catch(System.Web.Services.Protocols.SoapException)
>{
>Message.Text = "Login Error, please try again";
>return;
>}
>// Create a custom property for the folder.
>Property newProp = new Property();
>newProp.Name = "Department";
>newProp.Value = "Finance";
>Property[] props = new Property[1];
>props[0] = newProp;
>string folderName = "Budget";
>try
>{
>rs.CreateFolder(folderName, "/", props );
>Label2.Text="Folder created: "+ folderName;
>}
>catch(Exception ex)
>{
>Message.Text=ex.ToString();
>}
>
>
System.Net.WebException: The request failed with the error message:Object moved to here
This question is related to Microsoft Reporting Services Web service. I
tried asking it in RS groups but no one seems to be knowledgeable enough to
answer, so I wanted to try my chances here. Thanks...
I am trying to get the code below to work with no success, I googled the
issue but docs popped up provided little help. Basically I am trying to
create a directory in RS that uses Forms authentication. Everything works on
the Forms authentication side, but it looks like the cookie created using
the web service somehow does not satisfy RS and it tries to redirect to the
logon page.
Could you point me with a document or just provide me with a working sample?
I already tried Teo Lachev's example with no luck.
Thanks,
Skep...
PS: Both web application and the RS are on the same server.
ReportingService rs = new ReportingService();
ReportServerProxy server = new ReportServerProxy();
// Get the server URL from the Report Manager configuration file
server.Url = AuthenticationUtilities.GetWebServiceUrl();
bool passwordVerified = false;
try
{
server.LogonUser("user","password", null);
passwordVerified = true;
}
catch(System.Web.Services.Protocols.SoapException)
{
Message.Text = "Login Error, please try again";
return;
}
// Create a custom property for the folder.
Property newProp = new Property();
newProp.Name = "Department";
newProp.Value = "Finance";
Property[] props = new Property[1];
props[0] = newProp;
string folderName = "Budget";
try
{
rs.CreateFolder(folderName, "/", props );
Label2.Text="Folder created: "+ folderName;
}
catch(Exception ex)
{
Message.Text=ex.ToString();
}Hi Skeptical:
How is the LogonUser call itself authenticated? Do you have anon
access for that call?
I suspect you need to create a CookieContainer object and assign the
instance to the Cookie property of the SSRS proxy class. The
CookieContainer will accept the Set-Cookie header from SSRS and pass
the cookie along on subsequest requests.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 19 May 2005 15:58:56 -0500, "Skeptical" <skep@.nowhere.com>
wrote:
>Greetings,
>This question is related to Microsoft Reporting Services Web service. I
>tried asking it in RS groups but no one seems to be knowledgeable enough to
>answer, so I wanted to try my chances here. Thanks...
>
>I am trying to get the code below to work with no success, I googled the
>issue but docs popped up provided little help. Basically I am trying to
>create a directory in RS that uses Forms authentication. Everything works on
>the Forms authentication side, but it looks like the cookie created using
>the web service somehow does not satisfy RS and it tries to redirect to the
>logon page.
>Could you point me with a document or just provide me with a working sample?
>I already tried Teo Lachev's example with no luck.
>Thanks,
>Skep...
>PS: Both web application and the RS are on the same server.
>
>ReportingService rs = new ReportingService();
>ReportServerProxy server = new ReportServerProxy();
>// Get the server URL from the Report Manager configuration file
>server.Url = AuthenticationUtilities.GetWebServiceUrl();
>bool passwordVerified = false;
>try
>{
>server.LogonUser("user","password", null);
>passwordVerified = true;
>}
>catch(System.Web.Services.Protocols.SoapException)
>{
>Message.Text = "Login Error, please try again";
>return;
>}
>// Create a custom property for the folder.
>Property newProp = new Property();
>newProp.Name = "Department";
>newProp.Value = "Finance";
>Property[] props = new Property[1];
>props[0] = newProp;
>string folderName = "Budget";
>try
>{
>rs.CreateFolder(folderName, "/", props );
>Label2.Text="Folder created: "+ folderName;
>}
>catch(Exception ex)
>{
>Message.Text=ex.ToString();
>}
System.Net.WebException: The request was aborted: The request was canceled.
Hello everyone,
Can anyone help me solve this problem? I'm trying to upload files from a client side to the server side, it uploads fine for any small files under <20mb and fails any files >20mb. I have set in the server side web config for the Runtime executionTimeout="650" and the maximum size length is 100MB, it it still fails under 2 minutes from the time it starts upload to the time the request was aborted, the request was cancel. Can anyone tell me is this a timeout from the Client side or a Service side and how do I fix this timeout issue to get the upload files to the host without being timeout?
anyone?
Is the stack trace available?
I suspecting the web.config file doesn't even take effect.
minutem for replying, here is the trace log that fail to upload th large file, because the System.Net.WebException: The request was aborted: The request was canceled.
"12-04-2007 14:52:48: Uploading c:\test\AC.zip to server"
"12-04-2007 14:52:48: http://www.rsvr.com/uploadservice2.0/uploadservice.asmx/Login?uname=randd&pword=test"
"12-04-2007 14:52:53: Valid User."
"12-04-2007 14:52:53: Starting Upload:http://www.rsvr.com/uploadservice2.0/uploadservice.asmx/UploadFile?c:\test\AC.zip "
"12-04-2007 14:54:33: Upload Failed: The request was aborted: The request was canceled."
"12-04-2007 14:54:33: Upload Failed: System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
at System.Net.WebClient.UploadFile(String address, String method, String fileName)
System.Net.Webexecption on WebRequest.GetResponse
after a while, ive had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.
Something like this:
...
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
...
This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).
Acutally, when i perform this again, ill get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...
This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
ill get this error.
On my collegues machine, the same things still works fine, even on the
customers
server, but im not able to test/debug this one on my machine anymore.
I dont know, what could be the reason for it.
My XPs configuration seems very identical to my collegues one.
Also my XP Servicepacks, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!
Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?
Thanks in advance,
ThomasThis exception is also thrown if the statuscode is 404 for example. Have a
look at this:
<http://msdn.microsoft.com/library/d...o
pic.asp>
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"Thomas Geisel" <tgeisel@.symax.de> wrote in message
news:b455c2e.0501180203.cba6e16@.posting.google.com...
> Hi Everybody,
> after a while, ive had to maintain a ASP.NET/C# project, where
> during processing of an request, the same (local!) webserver is
> requested again for the response of a corresponding aspx-page.
> Something like this:
> ...
> string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
> WebRequest req = WebRequest.Create( uri );
> req.Credentials = CredentialCache.DefaultCredentials;
> WebResponse resp = req.GetResponse();
> Stream st = req.GetResponseStream;
> ...
> This worked fine on my machine a few month ago, as well as on my
> collegues machine and alos at the customer.
> On all 3 machines, the local IIS instance is responsible to process
> the aspx-Request (two XP-SP2, one W2k-Server).
> Acutally, when i perform this again, ill get a
> System.Net.Webexecption
> on the execution of "req.GetResponse()" with following error-stack
> System.Net.HttpWebRequest.CheckFinalStatus()
> System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> System.Net.HttpWebRequest.CheckFinalStatus()
> myModule.myMethod()
> etc. ...
> This error appears also, when i replace the uri above f.e. with
> 'http://www.google.com'.
> Even when i run a downloaded, ready-to-use C#-sample (EXE, not
> ASP.NET!),
> ill get this error.
> On my collegues machine, the same things still works fine, even on the
> customers
> server, but im not able to test/debug this one on my machine anymore.
> I dont know, what could be the reason for it.
> My XPs configuration seems very identical to my collegues one.
> Also my XP Servicepacks, Patches and .NET-Version look identical to
> my
> collegue ones.
> But there must be a difference!
> Does anyone has any idea, that maybe can keep me away from a complete
> reinstallation of my machine?
> Thanks in advance,
> Thomas
System.Net.Webexecption on WebRequest.GetResponse
after a while, ive had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.
Something like this:
...
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
...
This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).
Acutally, when i perform this again, ill get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...
This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
ill get this error.
On my collegues machine, the same things still works fine, even on the
customers
server, but im not able to test/debug this one on my machine anymore.
I dont know, what could be the reason for it.
My XPs configuration seems very identical to my collegues one.
Also my XP Servicepacks, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!
Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?
Thanks in advance,
ThomasThis exception is also thrown if the statuscode is 404 for example. Have a
look at this:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebrequestclassendgetresponsetopic.a sp
--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"Thomas Geisel" <tgeisel@.symax.de> wrote in message
news:b455c2e.0501180203.cba6e16@.posting.google.com ...
> Hi Everybody,
> after a while, ive had to maintain a ASP.NET/C# project, where
> during processing of an request, the same (local!) webserver is
> requested again for the response of a corresponding aspx-page.
> Something like this:
> ...
> string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
> WebRequest req = WebRequest.Create( uri );
> req.Credentials = CredentialCache.DefaultCredentials;
> WebResponse resp = req.GetResponse();
> Stream st = req.GetResponseStream;
> ...
> This worked fine on my machine a few month ago, as well as on my
> collegues machine and alos at the customer.
> On all 3 machines, the local IIS instance is responsible to process
> the aspx-Request (two XP-SP2, one W2k-Server).
> Acutally, when i perform this again, ill get a
> System.Net.Webexecption
> on the execution of "req.GetResponse()" with following error-stack
> System.Net.HttpWebRequest.CheckFinalStatus()
> System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
> System.Net.HttpWebRequest.CheckFinalStatus()
> myModule.myMethod()
> etc. ...
> This error appears also, when i replace the uri above f.e. with
> 'http://www.google.com'.
> Even when i run a downloaded, ready-to-use C#-sample (EXE, not
> ASP.NET!),
> ill get this error.
> On my collegues machine, the same things still works fine, even on the
> customers
> server, but im not able to test/debug this one on my machine anymore.
> I dont know, what could be the reason for it.
> My XPs configuration seems very identical to my collegues one.
> Also my XP Servicepacks, Patches and .NET-Version look identical to
> my
> collegue ones.
> But there must be a difference!
> Does anyone has any idea, that maybe can keep me away from a complete
> reinstallation of my machine?
> Thanks in advance,
> Thomas
System.NullReferenceException
I try to use this piece of code...
Dim CatID As Integer
CatID = (Request.QueryString("ID"))
CatID = 1
myProductsByCategory.Text = (GetProductsByCategory(CatID))
inside my Private Sub Page_Load but I get a System.NullReferenceException error from this.
What am I missing here?
Regards
MMy guess would be that the Querystring "ID" doesnt exist and you are getting a NULL exception when VB is converting it to an integer.
I hit Post too soon.. you might want to try to comment out the line that is assigning the value from the Querystring, since you are hardcoding it anyway (to 1).. see if thats the issue.
Hi
I comment out the querystring part, but that didn't help...
Regards
M
By the way... the function I try to call looks like this..
Function GetProductsByCategory(ByVal intID As Integer)
Dim connStr As String
connStr = ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connStr")Dim sb As StringBuilder = New StringBuilder
Dim sbOutput As StringDim MyConnection As SqlConnection
Dim MyCommand As SqlCommand
Dim MyDataReader As SqlDataReaderMyConnection = New SqlConnection(connStr)
Try
MyConnection.Open()
MyCommand = New SqlCommand("dbo.p_ShowProductsByCategories", MyConnection)
MyCommand.CommandType = CommandType.StoredProcedure
MyCommand.Parameters.Add("@.ID", SqlDbType.Int, 4).Value = intID
MyDataReader = MyCommand.ExecuteReader()sb.Append("<table width=""123"" border=""0"" cellpadding=""0"" cellspacing=""0"">")
While MyDataReader.Read
sb.Append("<tr>")
sb.Append("<td class=""menuitem"" onmouseover=""this.bgColor='#EEEEEE'"" onmouseout=""this.bgColor='#FDFDFD'"" style=""HEIGHT: 16px""> <a ref=""productdetail.aspx?ID=""" & (MyDataReader("ID")) & """>" & (MyDataReader("Description")) & "</a></td>" & vbCrLf)
sb.Append("</tr>")
End Whilesb.Append("</table>")
sbOutput = sb.ToString()
MyDataReader.Close()
MyConnection.Close()Catch ex As Exception
myErrorCode.Visible = True
myErrorCode.Text = (" ! An error occured <br> while accesing<br> products")
'Response.Write(ex.Message.ToString)
End Try
GetProductsByCategory = sbOutput
End Function
Regards
M
Ok.. is the runtime error not giving you the line number of the error? Are you sure the error is happening in those original 4 lines of code posted?
Try setting a breakpoint on the offending line and stepping through the GetProductsByCategory method to see where the problem lies.
(If you don't have Visual Studio you can use the CLR debugger in the .net framework SDK. You'll find it at
C:\Program Files\Microsoft.NET\FrameworkSDK\GuiDebug\DbgCLR.exe
You'll need to attach it to the aspnet_wp.exe process first. Choose "Debug Processes..." on the "Tools" menu, select aspnet_wp.exe and click "Attach".)
You are right, sorry! The line where the error is ...
myProductsByCategory.Text = (GetProductsByCategory(1))
Regards
M
Ok.. best case, your myProductsByCategory.Text is the problem.. worse case its a problem in the function, which is most likely the problem :)
connStr = ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connStr")
Are yousure that you have this entry in your web.config file?
Yes I have, I use that part in the sub page_load so I know thats working.
Regards
M
Time to step through your code and see whats up then :)
Hmmm... I found the problem, I have forgotten to add the runat=server to the label holding the result.
Regards
M
Tuesday, March 13, 2012
System.Security.SecurityException: Request failed.
i have uploaded a web site on a server and it is runnig but
when i try to access those pages on which i have coded to get data form ms access databae i received the following error
how can i correct this problem
the error is as following
Server Error in '/' Application.
Security Exception
Description:The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details:System.Security.SecurityException: Request failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:
[SecurityException: Request failed.] Data.createsession.startsession(String name, String password) +0 RUGUI.admin1.Button1_Click(Object sender, EventArgs e) in admin.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +2112 System.Web.UI.Page.ProcessRequest() +218 System.Web.UI.Page.ProcessRequest(HttpContext context) +18 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep
Does the ASPNET user, which ASP.NET runs under, have permissions to the Access database?
NC...
Your site is working in a medium trust or even low.
If you are hosting the site with a company then you have to ask them to increase the trust level. If you are running this in your server, then you should know that when you use OLD DB, this is out of the medium trust privileges. You can get that working with some modifications in the maching.config and web.config if you are using ASP.NET 2.0
Check the following articles at servertastic
http://www.servertastic.com/articles/category/aspnet/
Let me know if you need further info
Regards