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

5038HELP! connecting to .NET web services

Expand Messages
  • jedijay007
    Dec 7, 2005
    • 0 Attachment
      I just installed soap::lite for apache v.0.60. I created a simple
      hello world script in C# that I need to connect to using perl:


      #################################################################
      using System;
      using System.Collections;
      using System.ComponentModel;
      using System.Data;
      using System.Diagnostics;
      using System.Web;
      using System.Web.Services;

      namespace WebService1
      {
      [WebService(Namespace="http://gv-iis/nih/WebService1")]
      public class Service1 : System.Web.Services.WebService
      {
      public Service1()
      {
      //CODEGEN: This call is required by the
      ASP.NET Web Services Designer
      InitializeComponent();
      }

      #region Component Designer generated code
      ...
      ...
      #endregion


      [WebMethod]
      public string HelloWorld()
      {
      return "Hello World";
      }
      }
      }
      ###############################################################

      this is my perl script:
      ---------------------------------------------------------------
      use SOAP::Lite +trace => [transport => \&follow_fault];

      my $uri = "http://gv-iis/nih/WebService1";
      my $proxy = "$uri/Service1.asmx";

      my $soap = SOAP::Lite
      -> uri($uri)
      -> on_action( sub { join '/', $uri, $_[1] })
      -> proxy ($proxy);

      my $result = $soap->HelloWorld()->result || die "unable to get
      result";

      print "returned: $result";

      sub follow_fault {
      print '<pre>';
      print_r(\@_);
      print '</pre><br><hr><br>';
      }
      ---------------------------------------------------------------

      SOAP sucessfully connects to the web service but there is an error
      in transport. .NET returns a 500
      (script) error, the EXACT SAME 500 error as
      when I try to view the .asmx file in my web browser.

      I am new to .NET so my problem could be there but I really could use
      some direction. Any suggestions would be greatly appreciated.