Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2005

Tip: Looking for answers? Try searching our database.

System.UnauthorizedAccessException error when invoking a web method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joseph - 07 Oct 2005 10:37 GMT
I got this error when trying to invoke a web method in my
browser:System.UnauthorizedAccessException:    at
System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns,
CompilerParameters parameters, Evidence evidence)
  at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
  at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings,
Type[] types, String defaultNamespace, String location, Evidence evidence)
  at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings, Type type)
  at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
  at
System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[]
methodInfos)
  at
System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[]
methodInfos)
  at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type,
LogicalMethodInfo[] methodInfos)
  at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
  at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
  at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)I don't think there's a file access problem as I have
granted "full control" access to everyone in the C Drive of the web
server.My web server is running on IIS 6 on a box installed with Windows
Server 2003 Standard Edition and .NET framework v1.1.4322.Even running
locally on the web server gets this error.Thanks in advance.
Steven Cheng[MSFT] - 10 Oct 2005 04:37 GMT
Hi Joseph,

Welcome to ASPNET newsgroup.
Regarding on the problem you mentioned, it is likely a security permission
issue with the temp dir which is used by asp.net webservice to generate
some temp xml serialization assembleis. Different from the other temp
assembly which is generated under the ASPNET temp dir,  those xml
serlization temp assemblies used by ASP.NET webservice will be generated
under the c:\windows\temp  dir, and the process identity need
read/write/delete permissions (configure thourgh advanced setting) on it.  
You can found the folder list in the following article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html
/secmod15.asp

So you can check this permission (in addition to the asp.net's temp dir) on
your server to see whether it is configured correctly.  Also, make sure
you've applied the latest serice pack of the .NET framework (sp1 for .net
1.1)

Also, for thoubleshooting asp.net xml serialization related problem, we can
also turn on the trace output so that the intermediate temp assembly's
source code and the error info file(.err) will be put in the %windir%\temp\
folder. Just add the following item in machine.config

<system.diagnostics>
        <switches>
           <add name="XmlSerialization.Compilation" value="4"/>
        </switches>
   </system.diagnostics>

do a IISRESET to make the change take effect.

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
| From: "joseph" <joseph@bluefield.com.hk>
| Subject: System.UnauthorizedAccessException error when invoking a web
method
| Date: Fri, 7 Oct 2005 17:41:57 +0800
| Lines: 32
[quoted text clipped - 8 lines]
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:7984
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
[quoted text clipped - 12 lines]
| mappings)
|    at

System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[]
| methodInfos)
|    at

System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodI
nfo[]
| methodInfos)
|    at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type,
[quoted text clipped - 8 lines]
| Server 2003 Standard Edition and .NET framework v1.1.4322.Even running
| locally on the web server gets this error.Thanks in advance.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.