method in Class not visible

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default method in Class not visible

    Hi Everbody,

    i want to any class send to client side with Web Method. But there is a
    method in this class. altough its all property can be pass on client side, A
    method can't be pass. how can i pass a method in class?
    [WebMethod]

    public ogr getogr

    {

    return new ogr();

    }

    public class ogr

    {

    int i;

    public string test

    {

    Return "test";

    }

    }

    Client side

    public void getogr

    {

    WebService.ogr _ogr = WebService.getogr();

    _ogr.test(); // invisible

    }




    Erkan KURTULUŞ Guest

  2. Similar Questions and Discussions

    1. class is not visible
      Hi, I want to use a user control on my page. I want to reference to the control class from the page’s code-behind. I registered the control:...
    2. #25580 [WFx]: set_error_handler to a class/method resets class properties when error occurs
      ID: 25580 Updated by: sniper@php.net Reported By: paul dot liversidge at recycledpixels dot com Status: Wont...
    3. #25580 [Opn->WFx]: set_error_handler to a class/method resets class properties when error occurs
      ID: 25580 Updated by: sniper@php.net Reported By: paul dot liversidge at recycledpixels dot com -Status: Open...
    4. #25580 [Opn]: set_error_handler to a class/method resets class properties when error occurs
      ID: 25580 User updated by: paul.liversidge@recycledpixels.com Reported By: paul dot liversidge at recycledpixels dot com...
    5. #25580 [NEW]: set_error_handler to a class/method resets class properties when error occurs
      From: paul dot liversidge at recycledpixels dot com Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: ...
  3. #2

    Default Re: method in Class not visible

    This is default behavior. You can't change it.

    --
    Greetz,
    Jan
    __________________________________
    Read my weblog: [url]http://weblogs.asp.net/jan[/url]
    "Erkan KURTULUŞ" <ekurtulus@msn.com> schreef in bericht
    news:eE57sisyDHA.1576@TK2MSFTNGP11.phx.gbl...
    > Hi Everbody,
    >
    > i want to any class send to client side with Web Method. But there is a
    > method in this class. altough its all property can be pass on client side,
    A
    > method can't be pass. how can i pass a method in class?
    > [WebMethod]
    >
    > public ogr getogr
    >
    > {
    >
    > return new ogr();
    >
    > }
    >
    > public class ogr
    >
    > {
    >
    > int i;
    >
    > public string test
    >
    > {
    >
    > Return "test";
    >
    > }
    >
    > }
    >
    > Client side
    >
    > public void getogr
    >
    > {
    >
    > WebService.ogr _ogr = WebService.getogr();
    >
    > _ogr.test(); // invisible
    >
    > }
    >
    >
    >
    >

    Jan Tielens Guest

  4. #3

    Default Re: method in Class not visible

    may be you can create another service for the "test method" or published it
    as meber of "ogr", the behaviour is actually caused when ogr is serialized
    to XML, in only serializes the public members,

    but if you really want to this , then web services is not an option, .Net
    remoting make more sense when you can have an interface on both side,

    Regards
    --
    Erymuzuan Mustapa
    Inter Virtual Sdn. Bhd.
    See MIND at [url]http://www.MIND.com.my[/url]



    "Erkan KURTULUŞ" <ekurtulus@msn.com> wrote in message
    news:eE57sisyDHA.1576@TK2MSFTNGP11.phx.gbl...
    > Hi Everbody,
    >
    > i want to any class send to client side with Web Method. But there is a
    > method in this class. altough its all property can be pass on client side,
    A
    > method can't be pass. how can i pass a method in class?
    > [WebMethod]
    >
    > public ogr getogr
    >
    > {
    >
    > return new ogr();
    >
    > }
    >
    > public class ogr
    >
    > {
    >
    > int i;
    >
    > public string test
    >
    > {
    >
    > Return "test";
    >
    > }
    >
    > }
    >
    > Client side
    >
    > public void getogr
    >
    > {
    >
    > WebService.ogr _ogr = WebService.getogr();
    >
    > _ogr.test(); // invisible
    >
    > }
    >
    >
    >
    >

    Erymuzuan Mustapa Guest

  5. #4

    Default Re: method in Class not visible

    Use reflection and invoke the string "yourmethodname"
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139