Loading ...
Sorry, an error occurred while loading the content.

Simple problem, but can't work

Expand Messages
  • df991552
    I have a C# code here which calls the .cgi. I get this error: Method System.__ComObject.testmethod not found. public class test { public static void Main() {
    Message 1 of 1 , Jul 13, 2003
    • 0 Attachment
      I have a C# code here which calls the .cgi. I get this error: Method
      System.__ComObject.testmethod not found.



      public class test
      {
      public static void Main()
      {
      Type typ = Type.GetTypeFromProgID
      ("SOAP.Lite");
      object obj = Activator.CreateInstance(typ);
      object soaplite = typ.InvokeMember
      ("new",BindingFlags.InvokeMethod,null,obj,null);

      Object[] uri = {"urn:xmethodsInterop"};
      Object[] proxy =
      {"http://localhost:8080/solution4/hibye.cgi"};

      typ.InvokeMember
      ("uri",BindingFlags.InvokeMethod,null,soaplite,uri);
      typ.InvokeMember
      ("proxy",BindingFlags.InvokeMethod,null,soaplite,proxy);

      object [] input = {"Hello"};

      //Console.WriteLine(typ.InvokeMember
      ("testmethod",BindingFlags.InvokeMethod,null,null,null));
      try
      {
      Console.WriteLine(typ.InvokeMember
      ("testmethod",BindingFlags.InvokeMethod,null,null,null));

      }
      catch (Exception e1)
      {
      Console.WriteLine(e1.Message);
      }



      }
      }


      the CGI:

      use SOAP::Transport::HTTP;
      SOAP::Transport::HTTP::CGI
      -> dispatch_to('OurPackage')
      -> handle;


      package OurPackage;
      sub testmethod {
      return "hello, world, its ok!!";
      }
      sub bye {
      return "goodbye, cruel world";
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.