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. Exposing classes' methods/properties in Web Service [modified]

Exposing classes' methods/properties in Web Service [modified]

Scheduled Pinned Locked Moved C#
questionhelp
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.
  • I Offline
    I Offline
    impeham
    wrote on last edited by
    #1

    I have the following problem: i want to be able to fill a class with data in the client side which uses my web service and then send that class to one of its web methods. For this purpose, i used [Serializable] attribute above all my classes in the web service that should be available in the client side for that purpose. The problem is that i can see the classes in the client side, but can't call their methods and properties even though they are public. how can i do that? is there an attribute which should be used above each public method/property of a class which is marked Serializable? Thanks. -- modified at 5:30 Thursday 3rd August, 2006

    S 1 Reply Last reply
    0
    • I impeham

      I have the following problem: i want to be able to fill a class with data in the client side which uses my web service and then send that class to one of its web methods. For this purpose, i used [Serializable] attribute above all my classes in the web service that should be available in the client side for that purpose. The problem is that i can see the classes in the client side, but can't call their methods and properties even though they are public. how can i do that? is there an attribute which should be used above each public method/property of a class which is marked Serializable? Thanks. -- modified at 5:30 Thursday 3rd August, 2006

      S Offline
      S Offline
      sundar156
      wrote on last edited by
      #2

      Create an bject for the Class in the web service in your Application For Eg WebApplication1.MyWebservice1.Service1 ObJEct = new WebApplication1.MyWebservice1.Service1(); ObJEct.methdName(); By this you can call the Web methods and propertiesof your Web Services. Hope this Solves your problem. note : You should Add [WebMethod] attribute on top of all the methods in the web service to make the methods visible to your client .. -- modified at 17:27 Thursday 3rd August, 2006

      Luck is Opportunity with hardwork

      I 1 Reply Last reply
      0
      • S sundar156

        Create an bject for the Class in the web service in your Application For Eg WebApplication1.MyWebservice1.Service1 ObJEct = new WebApplication1.MyWebservice1.Service1(); ObJEct.methdName(); By this you can call the Web methods and propertiesof your Web Services. Hope this Solves your problem. note : You should Add [WebMethod] attribute on top of all the methods in the web service to make the methods visible to your client .. -- modified at 17:27 Thursday 3rd August, 2006

        Luck is Opportunity with hardwork

        I Offline
        I Offline
        impeham
        wrote on last edited by
        #3

        This is not the case... The problem is not with the Web service's methods (which are woking just fine). it is with classes that are used to create an object that should be used by the client to fill information. let's say i have the following in the web service's class "Service1": ----- [WebMethod] public string test(MyInfo TestData) ----- Now, "MyInfo" is a class which has other classes as attributes which have properties/methods. In the client side, i want to be able to fill the TestData class with information (and its internal classes) and send it to the method. These are the methods/properties i want to be able to use in the client side. So, to be able to see all the classes that MyInfo holds, i used [XmlInclude] attribute for each of these classes. now - i can create these classes and see them in the client, but all their properties/methods i cannot see even though they are public.

        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