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

Re: [soaplite] WebService Behavior and Soap::Lite

Expand Messages
  • Byrne Reese
    I was wondering if you ever got this working. If so, I would love to add this sample code to the documentation. If not, then at a glance I might suspect the
    Message 1 of 2 , Oct 20, 2004
    • 0 Attachment
      I was wondering if you ever got this working. If so, I would love to add
      this sample code to the documentation.

      If not, then at a glance I might suspect the following line:

      service.useService("access/soapserv.pl?WSDL","Demo",options);

      It appears that an assumption is being made about the existence of a
      WSDL, but unfortunately, no WSDL exsists for the service, nor is Perl
      capable of generating one at this time. This may be the source of the
      "Service Unavailable" message.

      Byrne

      opus23k wrote:

      > Well, I'm back. Lost an confused as usual.
      >
      > I'm trying to use the Microsoft WebService Behavior to call my perl
      > program which uses Soap::Lite. I'm starting out really simple, and I
      > have tested that my perl program works if called using the soap lite
      > client. But the WebService Behavior returns the error 'Service
      > Unavailable'.
      >
      > I desperately need help. I've scavenged the internet and have found
      > nothing about implementing MS WebService Behavior with Perl.
      >
      > Here's some code tidbits:
      >
      > *** CLIENT SIDE JAVASCRIPT/WebService Behavior ***
      >
      > <html>
      > <head>
      > <title>My Site</title>
      > <SCRIPT language="JavaScript">
      > function init()
      > {
      > var options = service.createUseOptions();
      > options.reuseConnection = true;
      >
      > service.useService("access/soapserv.pl?WSDL","Demo",options);
      > iResult = service.Demo.callService(handleResult,"hi",5,6);
      >
      > }
      >
      > function handleResult(result)
      > {
      >
      > if(result.error)
      > {
      > // Pull the error information from the
      > event.result.errorDetail properties
      > var xfaultcode = result.errorDetail.code;
      > var xfaultstring = result.errorDetail.string;
      > var xfaultsoap = result.errorDetail.raw;
      >
      > // Add code to handle specific error codes here
      > alert(xfaultstring+xfaultsoap);
      > }
      > else
      > {
      > alert(result.value);
      > }
      >
      > }
      >
      > </script>
      > </head>
      > <body onLoad="init()">
      > <div id="service" style="behavior:url(/webservice.htc)"></div>
      > </body>
      > </html>
      >
      >
      > *** SERVER SIDE APACHE/Soap::Lite (/access/soapserv.pl)***
      >
      > #!/usr/bin/perl
      >
      > use SOAP::Transport::HTTP;
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Demo')
      > -> handle;
      >
      > package Demo;
      >
      > sub hi
      > {
      > return "hello, world";
      > }
      >
      > sub bye
      > {
      > return "goodbye, cruel world";
      > }
    Your message has been successfully submitted and would be delivered to recipients shortly.