all groups > dotnet web services > february 2008 >
You're in the

dotnet web services

group:

Web service returning custom class fails if not running full trust



Web service returning custom class fails if not running full trust Richard Taylor
2/27/2008 1:38:00 PM
dotnet web services: I have some web services that I've written and a forms application that calls
my web services and is deployed using ClickOnce. I don't want to run the
forms application in full trust but it doesn't work if I don't. The problem
is that some of the web service calls are returning a custom class. These
calls fail with the exception below if the app doesn't have full trust. Calls
that don't deal with custom classes work just fine. Is there any way to
resolve this problem other than not using custom classes or running in full
trust?

System.InvalidOperationException: There is an error in XML document (1,
290). ---> System.Security.SecurityException: Request failed.
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderLogin.Read2_WorldInfo(Boolean isNullable, Boolean checkType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderLogin.Read12_GetWorldsResponse()
at
Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer17.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle, XmlDeserializationEvents events)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.PermissionSet
The demand was for:
<PermissionSet class="System.Security.PermissionSet"
version="1"
Unrestricted="true"/>
Re: Web service returning custom class fails if not running full trust nano2k
2/29/2008 1:03:26 PM
Richard

Sorry, can't help you out with your problem.
I'm now facing the challenge to return custom classes from the
webservice.
How do you do this?
I created a post on this subject here:

http://groups.google.ro/group/microsoft.public.dotnet.framework.webservices/=
browse_thread/thread/7e3d1f4feb45096d/69e2dc7fe1fcaa31?hl=3Dro#69e2dc7fe1fca=
a31

If you can share this, please do.
Sorry again for not being able to help you.

Thanks.


[quoted text, click to view]
AddThis Social Bookmark Button