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. serializing in client

serializing in client

Scheduled Pinned Locked Moved C#
sysadminhelpquestion
4 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.
  • B Offline
    B Offline
    balkang
    wrote on last edited by
    #1

    Hello, I have a data class in my Web Service server. Its name is User. When I include this web service to the client and name it "WSA" the User class will be WSA.User. the problem is when I serialize a User instance in client its type will be WSA.User and I can not deserialize it to a User instance in server. the types will be different. What can I do?

    J 1 Reply Last reply
    0
    • B balkang

      Hello, I have a data class in my Web Service server. Its name is User. When I include this web service to the client and name it "WSA" the User class will be WSA.User. the problem is when I serialize a User instance in client its type will be WSA.User and I can not deserialize it to a User instance in server. the types will be different. What can I do?

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Don't define User on both the client and server. Define User in a seperate dll, referenced by the service and client.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Horrific Minnesota Radio Judah Himango

      B 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Don't define User on both the client and server. Define User in a seperate dll, referenced by the service and client.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Horrific Minnesota Radio Judah Himango

        B Offline
        B Offline
        balkang
        wrote on last edited by
        #3

        Do you mean that... I should define a User dll on server. And both webservice and client should reference them?? I haven't experience of dlls. will it not be a problem for client to reference a dll in remote server?

        J 1 Reply Last reply
        0
        • B balkang

          Do you mean that... I should define a User dll on server. And both webservice and client should reference them?? I haven't experience of dlls. will it not be a problem for client to reference a dll in remote server?

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Create a dll that contains the User class. When you build the client, add a reference to the dll containing the user class. When you build the service, add a reference to the dll containing the user class. The client doesn't need to reference a remote dll, the user dll can be copied locally to both client and service. This way, both the client and service will be using the same object.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: Horrific Minnesota Radio Judah Himango

          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