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. Web service to call business logic class

Web service to call business logic class

Scheduled Pinned Locked Moved C#
business
8 Posts 4 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.
  • G Offline
    G Offline
    Gktony
    wrote on last edited by
    #1

    I need to create a web service to call a business logic class without using reflection. Can someone send me a sample Thanks

    H G 2 Replies Last reply
    0
    • G Gktony

      I need to create a web service to call a business logic class without using reflection. Can someone send me a sample Thanks

      H Offline
      H Offline
      Harvey Saayman
      wrote on last edited by
      #2

      heres a sample for you :)

      public answerToQuestion TryToGetHelpFromCP(string question)
      {
      if(you.isLazy)
      {
      return new answerToQuestion("Flames Like This");
      }
      else
      {
      return CPiansConsiderQuestion(question); // returnes an answer if there is one available
      }
      }

      Harvey Saayman - South Africa Junior Developer .Net, C#, SQL

      you.suck = (you.passion != Programming)

      G 1 Reply Last reply
      0
      • H Harvey Saayman

        heres a sample for you :)

        public answerToQuestion TryToGetHelpFromCP(string question)
        {
        if(you.isLazy)
        {
        return new answerToQuestion("Flames Like This");
        }
        else
        {
        return CPiansConsiderQuestion(question); // returnes an answer if there is one available
        }
        }

        Harvey Saayman - South Africa Junior Developer .Net, C#, SQL

        you.suck = (you.passion != Programming)

        G Offline
        G Offline
        Gktony
        wrote on last edited by
        #3

        Can the administrator block such kind of provocative replies please. Also the person who send it should be removed. This suppose to be a serious site

        D H 2 Replies Last reply
        0
        • G Gktony

          Can the administrator block such kind of provocative replies please. Also the person who send it should be removed. This suppose to be a serious site

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          Gktony wrote:

          This suppose to be a serious site

          Then ask a serious question AFTER reading the guidelines [^]at the very top of the forum paying particular attention to point 2.

          Dave

          1 Reply Last reply
          0
          • G Gktony

            Can the administrator block such kind of provocative replies please. Also the person who send it should be removed. This suppose to be a serious site

            H Offline
            H Offline
            Harvey Saayman
            wrote on last edited by
            #5

            Gktony wrote:

            Can the administrator block such kind of provocative replies please.

            And how would you suggest they do that? Delete the message maybe but block it all together?

            Gktony wrote:

            Also the person who send it should be removed.

            I have a name you know. and in my opinion YOU should be removed

            Gktony wrote:

            This suppose to be a serious site

            yes, its supposed to be... BUT you coming here demanding code for a very vague "question" isnt very serious! This is a FORUM where we discuss specific programming problems you might have come across. This is NOT some place where you can demand we do your work for you.

            Gktony wrote:

            I need to create a web service to call a business logic class without using reflection. Can someone send me a sample

            well congratulations, i need to write an application to calculate time and attendance data, but you dont see me asking people to do it for me. what have you tried? where are you having problems? have you heard of google? as my "joke code" implied if youre not willing to help yourself no one here will even bother to even try.

            Harvey Saayman - South Africa Junior Developer .Net, C#, SQL

            you.suck = (you.passion != Programming)

            1 Reply Last reply
            0
            • G Gktony

              I need to create a web service to call a business logic class without using reflection. Can someone send me a sample Thanks

              G Offline
              G Offline
              Gktony
              wrote on last edited by
              #6

              If you are not happy with the question there is a better way of putting it. Either ask to be more specific or ignore it (don’t bother as you mention). All of your writing is absolutely unnecessary and doesn’t help anyone. The reason I didn’t provide any code is because I know is only a line or two of code and yes I have search the web for it prior to my posting. I have got it working using reflection and I want to make it work without reflection. The code I used is, [WebMethod] public object ExecuteMethod( object ClassName, string method, params object[] arguments) { object returnedObject = ClassName.Method(); return returnedObject; } The problem I have is how to invoke the class name and method parameter in the web service

              P 1 Reply Last reply
              0
              • G Gktony

                If you are not happy with the question there is a better way of putting it. Either ask to be more specific or ignore it (don’t bother as you mention). All of your writing is absolutely unnecessary and doesn’t help anyone. The reason I didn’t provide any code is because I know is only a line or two of code and yes I have search the web for it prior to my posting. I have got it working using reflection and I want to make it work without reflection. The code I used is, [WebMethod] public object ExecuteMethod( object ClassName, string method, params object[] arguments) { object returnedObject = ClassName.Method(); return returnedObject; } The problem I have is how to invoke the class name and method parameter in the web service

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                Why is reflection such a no-no for you? The only other way I can think of is to dynamically create code to fire off this class/method. You would look to do this with the CodeDom.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                G 1 Reply Last reply
                0
                • P Pete OHanlon

                  Why is reflection such a no-no for you? The only other way I can think of is to dynamically create code to fire off this class/method. You would look to do this with the CodeDom.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  G Offline
                  G Offline
                  Gktony
                  wrote on last edited by
                  #8

                  Peter, Thanks for you reply. I got it working using reflection but it creates security issues and I want to avoid that. regards

                  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