Security :: Random Exception In A Web Service?
Jan 5, 2010
I'm getting this exception randomly in one webservice, it used to happen in the first call only, and in the second calls and so on it works fine ... and after a while without use the webservice it happens again. It seems to be that when the AppDomain is not loaded, the first time fails... and subsequent calls are ok; when IIS shutdown the AppDomain... the next call will fail again.
[code]....
View 4 Replies
Similar Messages:
Jul 2, 2010
I have added a service from a Win2003 server to my Visual Studio project on WinXP machine. Create an oject for this service went OK. But when I tried to run a method in the service I get "401 web exception while accessing a service.".
How to proceed?
View 1 Replies
Mar 17, 2011
The environment:
Development:
Windows 7 64bit running microsoft visual studio to develop an ASP.NET web application in C#.
Production:
Windows Server 2003 : Microsoft.Net V3.5 : IIS
Application:ASP.NET web application with forms authentication using an Active Directory provider to authenticate against our domain controller. Once authenticated users can select reports which populate a gridview with data from an SQL database.
Background:The web app works flawlessly on development and production. Users can navigate to, authenticate, and access all information on the web app.
Due to sensitive connectionString and active directory provider information in my web.config file we have decided to encrypt those parts.
After researching different methods we chose to do a machine level RSA encryption.
The method which we are following in CMD:
1. cd c:windowsmicrosoft.netframework"version"
2. aspnet_regiis -pc "containerName" //this creates the key container
3. aspnet_regiis -pa "containerName" "NTAUTHORITYNETWORK SERVICE" //this creates an ACL for the NETWORK SERVICE user to be able to access the
container and decrypt the web.config file
4. aspnet_regiis -pef "connectionStrings" "C:inetpubwebsiterootdir" -prov "provider" (where provider is the name of the encryption provider in
web.config) //this uses the encryption provider to encrypt the data then storing the key in the container that we created in step 2.
5. Repeat this process for any other sections of web.config with sensitive info.
View 4 Replies
Apr 26, 2010
I have a Menu with various Web Pages, as I click to nagivate from one Page to a nother, at random but not often, when I click on to open a Page it took me back to my Login page where user must enter the Name and Password again it then open the page else it doesn't do anything and stay on the login screen. This doesn't occur on my local development test.
On my Pages' Page_Load event I have this code
If
Not
Me.User.Identity.IsAuthenticated
Then
Response.Redirect("~/Login.aspx")
End
If
View 7 Replies
Jul 4, 2010
From what i know Random() is initialize to the current time. If two connections hit during the same second i should get the same two random numbers? With a large site that can be likely. Locking is bad so how should i solve it? note: the number is used for the session id.
-edit- i am stuck using a long. It feels wrong to shorten a 128bit GUID
View 2 Replies
Feb 8, 2010
I am getting an exception with the JSON Web Service with MVC 2.0.0.0.
Earlier it worked.
The code:
[Code]....
The exception:
[Code]....
View 10 Replies
Apr 2, 2013
Error:Â
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 for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Local its run fine. when i place in iis. it throw this exception.
View 1 Replies
Jul 22, 2010
I have created user web control library project and these controls i'm using in my web application. These User controls just works fine in my local machine but when i moved this project(including Library) to our Local server , it is throwing security exception
Error 1 Cannot register assembly "LocalServerLibraryDemoLibraryDemoLibraryinDebugLibrary.dll". Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Library
Anybody knows why this error occuring...?
View 2 Replies
Jul 26, 2010
I have a web service and its methods return a class which is name WSResult. WSResult has 2 properties. One of property's type is int and the other one's type is object. I want to return some different type with this second property.
[code]....
How can i pass an object which i retrieved from other web services or that i generated from my serializable classes inside M_ResultObject property ?
View 2 Replies
Dec 15, 2010
I create a table as picture below :
when I insert any character to column Name then A new string random will auto insert into column Random (picture below) I had used Trigger but It was error !
I want to column Random use to code :
DECLARE @myid uniqueidentifier
SET @myid = NEWID()
insert into table_1 values(@myid, substring(CONVERT(varchar(255), @myid), 1, 5))
but It must auto like column Number (column Number is Identity)
View 1 Replies
Sep 13, 2010
I am going to be receiving data in a web service. After I receive this data I will be mapping it to a data transfer object. I want to be able to catch exceptions if the data from the service is missing any of the required values, times out or any data is malformed.
What can I do to generally catch these exceptions?
View 1 Replies
Feb 1, 2010
I have the following problem with a slideshow in Ajax. Hope I have put it in the right Ajax forum. Some info: I do use MS Access and in the 'autos table' i do have the following fields:
field 1: nummer (text field) - this is the name of the image
field 2: cat (integer) - this is the category of the cars
field 3: naam (text field) - this is the name of the car
field 4: model (text field - this is the model of the car
In my masterpage i do have a menu where you can make the choice of a certain category of cars. This is done by a call to: slideshow.aspx?cat=100 In Slideshow.aspx a panel is setup and also buttons to manipulate the found images. Also the AjaxToolkit:Slideshowextender is defined as follows:
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServicePath="slideservice.asmx"
SlideShowServiceMethod="Getslides"
AutoPlay="true"
ImageTitleLabelID="Name"
ImageDescriptionLabelID="Desc"
NextButtonID="NextButton"
PlayButtonID="PlayButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="PrevButton"
PlayInterval="4000"
Loop="true"
ContextKey="catid" />
As you can see the contactkey is also defined.
Inside the codebehind of slideshow.aspx.vb their is a sub defined:
Partial Class Slideshow
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
SlideShowExtender1.ContextKey = Request.QueryString("catid")
End Sub
End Class
The call from slideshow.aspx is to a slideservice.asmx which contains:
<%@ WebService Language="VB" CodeBehind="~/App_Code/SlideService.vb" %>
Here we call slideservice.vb.
The coding of the slideservice.vb file is:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.OleDb
Imports System.Web.UI.Page
<WebService(Namespace:="http://vancouver.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
Public Class SlideService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function GetSlides(ByVal contextKey As String) As AjaxControlToolkit.Slide()
Dim strconn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Vancouver.mdb"
Dim cn As New OleDbConnection(strconn)
Dim SQLStr As String
SQLStr = "SELECT nummer, naam, model FROM Autos WHERE ((Autos.cat) = @catid)"
Try
cn.Open()
Dim cmd As New OleDbCommand(SQLStr, cn)
Dim sCatid As String = ""
' Give the value to sCatid from contextkey
If sCatid.Trim().Length = 0 Then sCatid = contextKey
cmd.Parameters.AddWithValue("@catid", sCatid)
Dim thisReader As OleDbDataReader = cmd.ExecuteReader()
Dim photoCounter As Integer
While thisReader.Read()
photoCounter = photoCounter + 1
End While
If (photoCounter > 0) Then
'we now know how many pictures there are in this category of the database
Dim MySlides(photoCounter - 1) As AjaxControlToolkit.Slide
'set up the command string
Dim photoLookupCmd As New OleDbCommand(SQLStr, cn)
'and add the parameters to it for the category
photoLookupCmd.Parameters.AddWithValue("@catid", sCatid)
thisReader = photoLookupCmd.ExecuteReader()
Dim i As Integer
For i = 0 To photoCounter - 1
thisReader.Read()
Dim number As String = thisReader.GetString(0)
Dim name As String = thisReader.GetString(1) + " - " + thisReader.GetString(2)
MySlides(i) = New AjaxControlToolkit.Slide(("pictures" + number + ".jpg"), name, "")
Next
thisReader.Close()
Return MySlides
Else
Dim MySlides(0) As AjaxControlToolkit.Slide
MySlides(0) = New AjaxControlToolkit.Slide("pictures99999.jpg", "sorry - not available", "pls. mail us to report")
thisReader.Close()
Return MySlides
End If
Catch x As Exception
Dim MySlides(0) As AjaxControlToolkit.Slide
MySlides(0) = New AjaxControlToolkit.Slide("pictures99999.jpg", "Exception error", "pls. mail us to report")
Return MySlides
Finally
cn.Close()
End Try
End Function
End Class
When i run the code i will get an exception error and when following the code in debug mode i do see that inside the first loop in FOR i = 0 to photocounter - 1 : The first loop gets the right info from the database inside Myslide(1) fields. Going into the second loop i will get after dim name as string .....
the program goes to catch x as exception. I did see that number was found correctly during the previuous line. During an other debug session i noticed that the Parameter.item has the following error (which I do not understand), saying: Overload resolution failed because no accessible 'Item´ accepts this number of arguments.
View 1 Replies
Sep 2, 2010
I have an Asp.net web service that I created using Visual Studio 2005. I can acess the web service in my test environment, call methods and return data as expected. If this web service is published to the outside world (Outside of the company firewall), it will return a null why this might be happening? The same code is being used,against the same database. The only difference is that the published website is giving back the null reference exception. If I type in the URL for the web service "https://secure.theSiteGeist.com/wsIndigo.asmx" a list of methods for the web service is displayed in my browser. Yet if I try and call any methods on the web service I get back the null reference exception. Note that the URL I posted above is not the real name of my web service, but is just used for reference sake.
View 3 Replies
Jan 23, 2010
I am writing two ASP.NET apps. One is a web service that provides xml data and the other is a web client that will use the service to display and manipulate data. I would like for the web service to do the membership authentication and authorization. Is there any way to simply point the login controls in my client application to the web service instead of to a database. I assume I would have to provide the necesarry methods in my web service interface, which would then use the membership provider database I created and pass the results back through to the client.
Is this possible? I have seen many articles on security provisioin from a web service but none has really been what I am looking for. I was hoping that, since my service and my client are both written in ASP.NET, there might be some built functionality that would benefit me.
View 8 Replies
Mar 10, 2010
First, I felt I had a clear understanding of how the Network Service account work. It is the default account ASP.Net runs under and has very limited access. I have verified in the Application Pool that ASP.Net is running under the Network Service Account. I have a UNC file share that is located on another server, let us say "\myservermyfiles". I have logged on to "MyServer" and right-clicked on the shared folder "myfiles" and just for the sake of testing, went to the Shared Tab->Permissions and added the Network Service account and gave it "change and read" access. I then went to the Security Tab, added the Network Service account and gave it all permissions. For some reason, I am still getting an "access denied" exception. I know impersonation is an option at some point, but I would really like to know why my ASP.Net application cannot copy a file to this share just for my own personal understanding given the fact that I gave the Network Service account the proper access. Like always, I will continue to research.
IIS 6
ASP.Net 2.0
View 24 Replies
Aug 11, 2010
how can we show error in our application when exception occur in webs service
View 10 Replies
Sep 14, 2010
We have an issue with a .NET 2.0 web service application that is generating a module not found exception when we try to load on server 2008. A second server running the same 2008 version loads the service fine.As part of the investigation we have taken the default hello world .NET 2.0 web service and deployed to both servers and have exactly the same issue with it running fine on one but not the other. The issue is trying to track down the module in question. Running process explorer and dependency walker doesn't seem to give us a clue.
The full error is:-
[code].....
View 1 Replies
Oct 21, 2010
I am trying to implement the Ajax HtmlEditor into my application. I currently am using a regular TextBox to load and save some data to some EMail template files and had to do some work-arounds to get it to accept the HTML Input. I am trying to upgrade it to use the Editor, but as soon as I insert the Editor and do a PostBack, I receive the Security Exception below. There is absolutely no change to the code-behind, so I don't understand the issue. There is so little on Google for the Version 3.5 Editor that I'm stumped. I have Debugging enabled, but it won't give me the Soruce Error either.
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:
[Code]....
:: REMOVED FOR SIMPLICITY :: Stack Trace:
[Code]....
View 3 Replies
Dec 15, 2010
I have to invoke SSIS packages from web service in the most secure way. I think that windows authentication will be secure but i am not sure. I do not have much knowledge about how to achieve this and the information on the internet is very distributed.
View 1 Replies
Oct 4, 2010
a C# file in my App_Code folder calls a C++ DLL that is in my BIN folder. I am getting following error:
Security Exception
Description:
The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException:
System.Security.Permissions.SecurityPermission
I hosted my application on GoDaddy shared server. They are not allowing me to give full trust to the application by changing setting in my application's web.config file.
View 3 Replies
Oct 30, 2010
I have hosted my website on godaddy and referenced MYSQL.Data.dll. This works fine on localhost. However when i try to run the same code online it throws the following error. System.Security.SecurityException: That assembly does not allow partially trusted callers.
I have downloaded the MqSQL.Data code version 6.2.4. which already has using System.Security; and [assembly: AllowPartiallyTrustedCallers()].
View 1 Replies
Jan 19, 2010
try to create a activex. if i use printdocument class it will throw security exception on client side. how to assign print permission for a assembly?
View 1 Replies
Jan 4, 2011
In the website that I'm developing, I need to send email via GMail for certain cases such as "forgot password". It's working properly on my PC but when I upload it to the server (which has windows 2003 running) I get the the following exception:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source Error:
[Code]....
Stack Trace:
[Code]....
View 2 Replies
Apr 5, 2012
I'm developing a usercontrol to use in SharePoint, and I think I need to use framework 3.5.
If I create a new web application targeting 3.5 and try to run it, I get this:
Code:
[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
I'm using file system run locally
View 2 Replies
Jun 21, 2010
I am using MVCcontrib grid in my application. Everything works fine on my dev machine. When I publish it to the server and navigate to the page that renders the grid I am getting this error 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 for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. and the source of the error is shown as <%= Html.Grid(Model).Columns(column => {i have added
[Code]....
to the web.config but still get the error
</textarea></p>
<input type='hidden' name='ID[9]' value='93970' />
<input type='hidden' name='URL[9]' value=[URL]/>
<input type='hidden' name='CAT[9]' value='DataSource Controls' />
<input type='hidden' name='BOARD[9]' value='microsoft' />
<input type='hidden' name='P_DATE[9]' value='Jan 12, 2010 09:43 PM' />
<input type='hidden' name='RANDOM[9]' value='BcIlUOXzN' />
<input type='hidden' name='REPLIES[9]' value='3' />
<input type='hidden' name='USER[9]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[9]' value='DataSource Controls :: LINQ using stored procedures and MvcContrib Grid with pagination' /><select name='INDEXED[9]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Jan 12, 2010 09:43 PM - Replies: 3 CAT: DataSource Controls<a target=_blank href=[URL]>View</a></p>
<p> <textarea rows=10 cols=100 name='POST[9]' onfocus='setSelRange(this, 0, 0)'/>All,
I have been chasing this erorr all day and coming up blank. I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.
It generated this:
[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")]
public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId);
return ((ISingleResult<ServiceTemplate>)(result.ReturnValue));
}
I call it from my service with the following method:
public ISingleResult<ServiceTemplate> GetByFkId(int FkId)
{
return Db.usp_ServiceTemplateSelectByFkId(FkId);
}
I have tested the stored procedure and it returns the results I want. When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times). .........
View 4 Replies