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

Accesing SOAP::Lite service with .NET client

Expand Messages
  • Khamesra, SandeepX
    I tried a .NET client to talk to SOAP::Lite ..Follwoed the interoperability doc. but I still do not get any value back from the SOAP::Lite server.. If I run
    Message 1 of 1 , Apr 30, 2002
    • 0 Attachment

      I tried a .NET client to talk to SOAP::Lite ..Follwoed the interoperability doc. but I still do not get any value back from the SOAP::Lite server..

      If I run the same service with the SOAP::Lite client , it works fine.. Could you please help me in this

      I am attaching my code

      SOAP::Lite Server code

      ---------------------------------------

      #!/usr/bin/perl -w

      use SOAP::Transport::HTTP;

      SOAP::Transport::HTTP::CGI

      ->dispatch_to('Example1')

      ->handle;

      package Example1;

      sub sayHello {

      my ($self, $output) = @_ ;

      return SOAP::Data->name('myname')

      ->type('string')

      ->uri('http://tempuri.org/')

      ->value($output);

      }

      --------------------------------------

      .NET client

      --------------------------------------------------

      using System.Diagnostics;

      using System.Xml.Serialization;

      using System;

      using System.Web.Services.Protocols;

      using System.Web.Services;

      [System.Web.Services.WebServiceBindingAttribute(

      Name="Example1Soap",

      Namespace="urn:Example1")]

      public class Example1 :

      System.Web.Services.Protocols.SoapHttpClientProtocol {

      public Example1( ) {

      this.Url = "http://10.10.33.45/cgi-bin/Example1.cgi";

      }

      [System.Web.Services.Protocols.SoapDocumentMethodAttribute(

      "urn:Example1/sayHello",

      RequestNamespace="urn:Example1",

      ResponseNamespace="urn:Example1",

      Use=System.Web.Services.Description.SoapBindingUse.Literal,

      ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

      public string sayHello(string name) {

      object[] results = this.Invoke("sayHello",new object[] {name});

      return ((string)(results[0]));

      }

      public static void Main(string[] args) {

      Console.WriteLine("Calling the SOAP Server to say hello");

      Example1 example1 = new Example1( );

      Console.WriteLine("The SOAP Server says: " +

      example1.sayHello(args[0]));

      }

      }

      -------------------------------------------------

      SOAP::Lite client which works well

      --------------------------------------------------

      #!/usr/bin/perl -w

      use SOAP::Lite;

      print SOAP::Lite

      ->uri('http://tempuri.org/Example1')

      ->proxy('http://10.10.33.45/cgi-bin/Example1.cgi')

      ->on_debug(sub{print@_})

      ->sayHello("This is Sandeep ")

      ->result;

      ---------------------------------------------------

    Your message has been successfully submitted and would be delivered to recipients shortly.