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

Basic pattern matching question

Expand Messages
  • guylill
    Hi! I have spent too many hours trying to work this out. Can anyone help? I m simply trying to set up two simple operations on a SOAP::Lite server: 1) I need
    Message 1 of 2 , May 23, 2007
    View Source
    • 0 Attachment
      Hi! I have spent too many hours trying to work this out. Can anyone
      help? I'm simply trying to set up two simple operations on a
      SOAP::Lite server:

      1) I need to convert an input string to upper case if any lower case
      characters are found.

      2) The second operation needs to perform the opposite: convert a
      string to lower case if upper case characters found. Here's the code:

      use SOAP::Lite;
      use SOAP::Transport::HTTP ;

      my $port = shift ;

      my $soapServer = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => $port )
      -> dispatch_to ( qw(echoString) )
      -> on_action ( sub {
      die "SOAPAction should be \"http://soapinterop.org/
      \"\n"
      unless $_[0] eq '"http://soapinterop.org/"';} ) ;

      print "Starting SOAP server on URL: ".$soapServer->url."\n" ;
      $soapServer->handle;

      sub echoString {
      # Receives a string and echoes it back
      my ($class, $inputString) = @_ ;
      die "no input provided\n" if !$inputString ;

      $inputString =~ tr/A-Z/a-z/ if $inputString =~ m/[A-Z]/ ;
      $inputString =~ tr/a-z/A-Z/ if $inputString =~ m/[a-z]/ ;

      return SOAP::Data->name('return')->type('string')->value
      ($inputString);
      }

      The code gives the following error on the command line: Use of
      uninitialized value in pattern match (m//)
      at /usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 429. proxy:
      transport protocol not specified

      Any help would be much appreciated! :)
    • Joe Hourcle
      ... [trimmed] ... You ve given us server code, but the error is likely in the client code. Specifically, that error occurs when you try to call a service where
      Message 2 of 2 , May 23, 2007
      View Source
      • 0 Attachment
        On Wed, 23 May 2007, guylill wrote:

        > Hi! I have spent too many hours trying to work this out. Can anyone
        > help? I'm simply trying to set up two simple operations on a
        > SOAP::Lite server:

        [trimmed]

        > The code gives the following error on the command line: Use of
        > uninitialized value in pattern match (m//)
        > at /usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 429. proxy:
        > transport protocol not specified

        You've given us server code, but the error is likely in the client code.

        Specifically, that error occurs when you try to call a service where
        you haven't defined a SOAP proxy.


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