<WebMethod()> In Front Of Each public function ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tiraman

    <WebMethod()> In Front Of Each public function ?

    Hi,

    i have a class with few functions which some of them are public.

    why not to put the <WebMethod()> in front of each public function as a
    concept ?


    --
    Best Regards ,

    Tiraman :-)


  • Herfried K. Wagner [MVP]

    #2
    Re: &lt;WebMethod() &gt; In Front Of Each public function ?

    * Tiraman <tiraman@netvis ion.net.il> scripsit:[color=blue]
    > i have a class with few functions which some of them are public.
    >
    > why not to put the <WebMethod()> in front of each public function as a
    > concept ?[/color]

    Why do you want to do that?!

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>

    Comment

    • Scott M.

      #3
      Re: &lt;WebMethod() &gt; In Front Of Each public function ?

      Webmethod indicates that it is a callable method of a web service. Public
      means that is available to other classes in the assembly. 2 different
      things.

      It could be public to the assembly but not callable via a web service.


      "Tiraman" <tiraman@netvis ion.net.il> wrote in message
      news:uMaOyW2aEH A.556@tk2msftng p13.phx.gbl...[color=blue]
      > Hi,
      >
      > i have a class with few functions which some of them are public.
      >
      > why not to put the <WebMethod()> in front of each public function as a
      > concept ?
      >
      >
      > --
      > Best Regards ,
      >
      > Tiraman :-)
      >
      >[/color]


      Comment

      • Tiraman

        #4
        Re: &lt;WebMethod() &gt; In Front Of Each public function ?

        bcz in that way there is no need to change the code when i will be ask to
        make the function available for the web.

        the question is why not ?
        is it a performance issue ?

        10x

        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
        news:MPG.1b6247 61bdadcc7998969 1@127.0.0.1...[color=blue]
        > * Tiraman <tiraman@netvis ion.net.il> scripsit:[color=green]
        > > i have a class with few functions which some of them are public.
        > >
        > > why not to put the <WebMethod()> in front of each public function as a
        > > concept ?[/color]
        >
        > Why do you want to do that?!
        >
        > --
        > Herfried K. Wagner [MVP]
        > <URL:http://dotnet.mvps.org/>[/color]


        Comment

        • Tiraman

          #5
          Re: &lt;WebMethod() &gt; In Front Of Each public function ?

          ok but as far as i know it can't be private in the assembly and callable via
          a web service.


          "Scott M." <s-mar@nospam.nosp am> wrote in message
          news:#vdkCp2aEH A.2340@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Webmethod indicates that it is a callable method of a web service. Public
          > means that is available to other classes in the assembly. 2 different
          > things.
          >
          > It could be public to the assembly but not callable via a web service.
          >
          >
          > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
          > news:uMaOyW2aEH A.556@tk2msftng p13.phx.gbl...[color=green]
          > > Hi,
          > >
          > > i have a class with few functions which some of them are public.
          > >
          > > why not to put the <WebMethod()> in front of each public function as a
          > > concept ?
          > >
          > >
          > > --
          > > Best Regards ,
          > >
          > > Tiraman :-)
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Scott M.

            #6
            Re: &lt;WebMethod() &gt; In Front Of Each public function ?

            Sure it can....and that's the point!


            "Tiraman" <tiraman@netvis ion.net.il> wrote in message
            news:u71Ckf3aEH A.3764@TK2MSFTN GP10.phx.gbl...[color=blue]
            > ok but as far as i know it can't be private in the assembly and callable[/color]
            via[color=blue]
            > a web service.
            >
            >
            > "Scott M." <s-mar@nospam.nosp am> wrote in message
            > news:#vdkCp2aEH A.2340@TK2MSFTN GP09.phx.gbl...[color=green]
            > > Webmethod indicates that it is a callable method of a web service.[/color][/color]
            Public[color=blue][color=green]
            > > means that is available to other classes in the assembly. 2 different
            > > things.
            > >
            > > It could be public to the assembly but not callable via a web service.
            > >
            > >
            > > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
            > > news:uMaOyW2aEH A.556@tk2msftng p13.phx.gbl...[color=darkred]
            > > > Hi,
            > > >
            > > > i have a class with few functions which some of them are public.
            > > >
            > > > why not to put the <WebMethod()> in front of each public function as a
            > > > concept ?
            > > >
            > > >
            > > > --
            > > > Best Regards ,
            > > >
            > > > Tiraman :-)
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: &lt;WebMethod() &gt; In Front Of Each public function ?

              * Tiraman <tiraman@netvis ion.net.il> scripsit:[color=blue]
              > bcz in that way there is no need to change the code when i will be ask to
              > make the function available for the web.
              >
              > the question is why not ?
              > is it a performance issue ?[/color]

              IMO it simply doesn't make sense. I would mark methods as webmethod "by
              need" so the code is easier to understand. When marking every method as
              webmethod, this would semantically make no sense for most methods.

              --
              Herfried K. Wagner [MVP]
              <URL:http://dotnet.mvps.org/>

              Comment

              • Tiraman

                #8
                Re: &lt;WebMethod() &gt; In Front Of Each public function ?

                Ok.

                10x

                "Scott M." <s-mar@nospam.nosp am> wrote in message
                news:ueeDrU5aEH A.1656@TK2MSFTN GP09.phx.gbl...[color=blue]
                > Sure it can....and that's the point!
                >
                >
                > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
                > news:u71Ckf3aEH A.3764@TK2MSFTN GP10.phx.gbl...[color=green]
                > > ok but as far as i know it can't be private in the assembly and callable[/color]
                > via[color=green]
                > > a web service.
                > >
                > >
                > > "Scott M." <s-mar@nospam.nosp am> wrote in message
                > > news:#vdkCp2aEH A.2340@TK2MSFTN GP09.phx.gbl...[color=darkred]
                > > > Webmethod indicates that it is a callable method of a web service.[/color][/color]
                > Public[color=green][color=darkred]
                > > > means that is available to other classes in the assembly. 2 different
                > > > things.
                > > >
                > > > It could be public to the assembly but not callable via a web service.
                > > >
                > > >
                > > > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
                > > > news:uMaOyW2aEH A.556@tk2msftng p13.phx.gbl...
                > > > > Hi,
                > > > >
                > > > > i have a class with few functions which some of them are public.
                > > > >
                > > > > why not to put the <WebMethod()> in front of each public function as[/color][/color][/color]
                a[color=blue][color=green][color=darkred]
                > > > > concept ?
                > > > >
                > > > >
                > > > > --
                > > > > Best Regards ,
                > > > >
                > > > > Tiraman :-)
                > > > >
                > > > >
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Tiraman

                  #9
                  Re: &lt;WebMethod() &gt; In Front Of Each public function ?

                  ok,
                  i got your point.

                  10x

                  "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                  news:MPG.1b6299 f152cede6f98969 5@127.0.0.1...[color=blue]
                  > * Tiraman <tiraman@netvis ion.net.il> scripsit:[color=green]
                  > > bcz in that way there is no need to change the code when i will be ask[/color][/color]
                  to[color=blue][color=green]
                  > > make the function available for the web.
                  > >
                  > > the question is why not ?
                  > > is it a performance issue ?[/color]
                  >
                  > IMO it simply doesn't make sense. I would mark methods as webmethod "by
                  > need" so the code is easier to understand. When marking every method as
                  > webmethod, this would semantically make no sense for most methods.
                  >
                  > --
                  > Herfried K. Wagner [MVP]
                  > <URL:http://dotnet.mvps.org/>[/color]


                  Comment

                  Working...