Showing posts with label failed. Show all posts
Showing posts with label failed. Show all posts

Saturday, March 24, 2012

System.Net.WebException: The request failed with the error message:Object moved to he

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();
}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

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();
}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();
>}

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