473,732 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Web Services from a Web Form throws CAS violation

We created a C# Windows forms application and put the .EXE on our web server.

We can download the executable from the web server to a desktop and it will
display OK. When we click a button that causes the executable to call a web
service on the same web server, we get the following code access security
violation.

-------------- begin violation -------------------------------------------
Could not talk to the web server. Error = 'System.Invalid OperationExcept ion:
There is an error in XML document (1, 269). --->
System.Security .SecurityExcept ion: Security error.

at
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReader1.Read2 _ReturnDS(Boole an isNullable, Boolean checkType)

at
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReader1.Read9 _StorlibReadRes ponse()

The granted set of the failing assembly was:
<PermissionSe t class="System.S ecurity.Permiss ionSet"
version="1">

<IPermission class="System.S ecurity.Permiss ions.FileDialog Permission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"/>

<IPermission
class="System.S ecurity.Permiss ions.IsolatedSt orageFilePermis sion, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Allowed="None"/>

<IPermission class="System.S ecurity.Permiss ions.SecurityPe rmission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Flags="Executio n"/>

<IPermission class="System.S ecurity.Permiss ions.UIPermissi on, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Window="SafeTop LevelWindows"/>

<IPermission class="System.N et.DnsPermissio n, System, Version=1.0.500 0.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"/>

<IPermission class="System.D rawing.Printing .PrintingPermis sion,
System.Drawing, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a"
version="1"
Level="NoPrinti ng"/>

<IPermission class="System.D iagnostics.Perf ormanceCounterP ermission,
System, Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"/>

<IPermission class="System.S ecurity.Permiss ions.UrlIdentit yPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Url="file://C:/winnt/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll"/>

<IPermission class="System.S ecurity.Permiss ions.ZoneIdenti tyPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Zone="MyCompute r"/>

</PermissionSet>

--- End of inner exception stack trace ---

at System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader
xmlReader, String encodingStyle)
at System.Xml.Seri alization.XmlSe rializer.Deseri alize(XmlReader xmlReader)
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters)
at BackIssue.com.k cc.cad.Service. StorlibRead(Str ing wildcard)
at BackIssue.FormM ain.searchForWi ldcard()'

---------------- end violation -------------------------------------------

What do I need to do to get past this violation?

Joe
Nov 23 '05 #1
0 1722

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1524
by: john | last post by:
I have a service that checks the event log for certain types of error messages. It kept locking up so I put in debugging code to see where the problem was. It's locking up when I call the property EventLogEntry.Message. I have search message boards and have found a few people complaining that this property throws a strange exception. It doesn't just lock up the thread that is calling it, but it locks up other unrelated threads too. In...
9
4350
by: Eddie J | last post by:
I'm getting an intermittent error when calling a .NET web service from a .NET console application. Both are using v.1.1.4322 of the framework. Any ideas on what could be causing this? It can fail and then a few seconds later can work fine. The exception is: <log4net:event logger="WRDataSyncApp" timestamp="2005-01-11T03:00:49.7336956-05:00" level="ERROR" thread="5808"
2
2859
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol Win32 exe project
8
7189
by: Marc | last post by:
Hi! I'm calling a web service using C# and a wrapper class generated by wsdl tool. The web service specification contains some nillable parameters which types are Value Types in .NET (long, int, Decimal, ....) and I must to send them as null, and not their default value. It is possible? Is there any trick to succeed it? Thanks in advance,
7
6019
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is or do i need to write the xml as text from the web service and supply a DTD. Also any other pitfalls TIA
0
1992
by: Don | last post by:
I have established a web reference to the WSDL of a web service written in Java. Successfully instantiated all my class objects and assigned values to required properties. When I call the webmethod though I receive back the following exception: System.Web.Services.Protocols.SoapException: java.rmi.RemoteException: Java.lang.NullPointerException at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage...
0
1714
by: samiam | last post by:
I know that "a new transaction" can be started from a web method by simply using an attribute " I guess the assumption here is that if the web method returns normally, the transaction is automatically committed. Likewsie, if an exception throws, the transaction is automatically aborted. However, there are business scenarios under which I want to explicitly abort the transaction in my web method. I heard this can be achieved with
0
2293
by: =?Utf-8?B?S2V2aW4gU2NobmVpZGVy?= | last post by:
I have two projects (one using .NET 1.1 the other using 2.0). When I call a particular method in a webservice from the 1.1 project everything works great. When I call the same method from the 2.0 project (identical code) it throws an exception with the message: "{"Item has already been added. Key in dictionary: 'AutoCompleteBackOrders.SopranoWebServices.BaseRequestDTO' Key being added:...
0
1112
by: dev | last post by:
I have a website that dynamically instantiates an instance of a class using Reflection from another Assembly. Within that class there is a method that calls a webservice. The webservice is a standard MS Proxy class that inherits from SoapHttpClientProtocol. Currently the DLL that is loaded via webapp resides in the BIN directory of the application. Due to some deployment requirements the DLL needs to be changed to another directory. ...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.