Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Remoting - Custom objects

Remoting - Custom objects

Scheduled Pinned Locked Moved C#
csharpdatabasesysadmindata-structuressecurity
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tatham
    wrote on last edited by
    #1

    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, ISerializable

    Now, 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,

    R 1 Reply Last reply
    0
    • T Tatham

      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, ISerializable

      Now, 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,

      R Offline
      R Offline
      Ranjan Banerji
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • R Ranjan Banerji

        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

        T Offline
        T Offline
        Tatham
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups