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

A Fix for Soap Server and WSDL Files

Expand Messages
  • jpeyser
    For those who are able to generate WSDL files outside of SOAP::Lite, but need the SOAP server to return WSDL file, there is the following fix (from the example
    Message 1 of 2 , May 27 1:48 PM
    • 0 Attachment
      For those who are able to generate WSDL files outside of SOAP::Lite,
      but need the SOAP server to return WSDL file, there is the following
      fix (from the example in HTTP::Daemon)

      In package SOAP::Transport::HTTP::Daemon, modify the following
      subroutine.

      sub handle {
      my $self = shift->new;
      while (my $c = $self->accept) {
      while (my $r = $c->get_request) {
      if ($r->method eq 'GET') {
      my $wsdl_file = $r->url->epath;
      $wsdl_file =~ s/^\///;
      $c->send_file_response($wsdl_file);
      } else {
      $self->request($r);
      $self->SUPER::handle;
      $c->send_response($self->response);
      }
      }
      # replaced ->close, thanks to Sean Meisner
      <Sean.Meisner@...>
      # shutdown() doesn't work on AIX. close() is used in this case.
      Thanks to Jos Clijmans <jos.clijmans@...>
      UNIVERSAL::isa($c, 'shutdown') ? $c->shutdown(2) : $c->close();
      undef $c;
      }
      }

      For example, a client call containing service
      ('http://hostname:1234/wsdl/quote.wsdl') would result in the server
      returning the file quote.wsdl from server subdirectory wsdl.

      By the way, I use gSoap, which generates WSDL files from C header
      files. The WSDL files seem to be very reliable (and very quick to
      create).

      Jonathan
    • jpeyser
      For those who are able to generate WSDL files outside of SOAP::Lite, but need the SOAP server to return WSDL file, there is the following fix (from the example
      Message 2 of 2 , May 27 1:49 PM
      • 0 Attachment
        For those who are able to generate WSDL files outside of SOAP::Lite,
        but need the SOAP server to return WSDL file, there is the following
        fix (from the example in HTTP::Daemon)

        In package SOAP::Transport::HTTP::Daemon, modify the following
        subroutine.

        sub handle {
        my $self = shift->new;
        while (my $c = $self->accept) {
        while (my $r = $c->get_request) {
        if ($r->method eq 'GET') {
        my $wsdl_file = $r->url->epath;
        $wsdl_file =~ s/^\///;
        $c->send_file_response($wsdl_file);
        } else {
        $self->request($r);
        $self->SUPER::handle;
        $c->send_response($self->response);
        }
        }
        # replaced ->close, thanks to Sean Meisner
        <Sean.Meisner@...>
        # shutdown() doesn't work on AIX. close() is used in this case.
        Thanks to Jos Clijmans <jos.clijmans@...>
        UNIVERSAL::isa($c, 'shutdown') ? $c->shutdown(2) : $c->close();
        undef $c;
        }
        }

        For example, a client call containing service
        ('http://hostname:1234/wsdl/quote.wsdl') would result in the server
        returning the file quote.wsdl from server subdirectory wsdl.

        By the way, I use gSoap, which generates WSDL files from C header
        files. The WSDL files seem to be very reliable (and very quick to
        create).

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