Remoting - Custom objects
-
I am currently developing a remoting object for my wbsite (www.play47.net) and am experiencing the following problem. If you have any ideas, they would be greatly appreciated... The remoting object has the following method:
public void MailQueueItemsSet(MailQueueItem job)
This returns a custom object which I have defined back to the DB (ie deletes / updates and needed). This object (MailQueueItem) has the following definition:
[Serializable()]
public class MailQueueItem : DataItem, ISerializableNow, from my client application I call the following method:
coordination.MailQueueItemsSet(job);
And receive this exception:
System.Runtime.Serialization.SerializationException: Because of security restrictions, the type play47.mail.RemotingInterfaces.MailQueueItem cannot be accessed. ---> System.Security.SecurityException: Request failed.
at System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet)
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
--- End of inner exception stack trace ---Server stack trace:
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, -
I am currently developing a remoting object for my wbsite (www.play47.net) and am experiencing the following problem. If you have any ideas, they would be greatly appreciated... The remoting object has the following method:
public void MailQueueItemsSet(MailQueueItem job)
This returns a custom object which I have defined back to the DB (ie deletes / updates and needed). This object (MailQueueItem) has the following definition:
[Serializable()]
public class MailQueueItem : DataItem, ISerializableNow, from my client application I call the following method:
coordination.MailQueueItemsSet(job);
And receive this exception:
System.Runtime.Serialization.SerializationException: Because of security restrictions, the type play47.mail.RemotingInterfaces.MailQueueItem cannot be accessed. ---> System.Security.SecurityException: Request failed.
at System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet)
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
--- End of inner exception stack trace ---Server stack trace:
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream,Have you added the remoting object to your web config under the well known objects? If not then the .Net security will not let you use the object. I think there are a few examples of how to set up Remoting on CP. Just search for Remoting and you will find some good articles on how to set up and use remoting. See: http://www.codeproject.com/useritems/iishostedremoting.asp?target=remoting
-
Have you added the remoting object to your web config under the well known objects? If not then the .Net security will not let you use the object. I think there are a few examples of how to set up Remoting on CP. Just search for Remoting and you will find some good articles on how to set up and use remoting. See: http://www.codeproject.com/useritems/iishostedremoting.asp?target=remoting
Ok, I thought you only had to include it in the config to get an instance, then from there on it just got whatever objects it needed. Thanks for your help... Most appreciated - it works now! :-D Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript) tatham@e-oddie.com +61 414 275 989