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 calling business logic

Web service calling business logic

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

    Hi all, I need to call a business logic class via web servicing without using reflection. I pass the class name and method as string parameters in the web service. But it doesn't work the conversion from string to an object. If I pass the object class then it works but I don't want to do that as the webservice must run independently The code I use is, [WebMethod] public object ExecuteMethod(string ClassName, string MethodName, params object[] arguments) { object obj = null; Type type = Type.GetType(ClassName); try { obj = type.InvokeMember(MethodName, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, arguments); } catch { throw; } return obj; } Thanks in advance

    L 1 Reply Last reply
    0
    • G Gktony

      Hi all, I need to call a business logic class via web servicing without using reflection. I pass the class name and method as string parameters in the web service. But it doesn't work the conversion from string to an object. If I pass the object class then it works but I don't want to do that as the webservice must run independently The code I use is, [WebMethod] public object ExecuteMethod(string ClassName, string MethodName, params object[] arguments) { object obj = null; Type type = Type.GetType(ClassName); try { obj = type.InvokeMember(MethodName, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, arguments); } catch { throw; } return obj; } Thanks in advance

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      ClassName need to be a fully qualified type name. BTW: what you are doing is reflection :)

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 alpha 4a out now (29 May 2008)

      G 1 Reply Last reply
      0
      • L leppie

        ClassName need to be a fully qualified type name. BTW: what you are doing is reflection :)

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 alpha 4a out now (29 May 2008)

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

        Could you provide me with the code without using reflection Thanks

        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