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

2697Re: [soaplite] Error Trying to parse out Header info

Expand Messages
  • Byrne Reese
    Jun 10, 2003
    • 0 Attachment
      Just a quick shot in the dark, but I believe you need to wrap your
      package declaration in a BEGIN block.

      Try:

      BEGIN{
      package Echo;
      use strict;

      use vars qw(@ISA);
      @ISA = qw(SOAP::Server::Parameters);

      sub echo
      {
      my $self = shift;
      my $envelope = pop;
      my $str = $envelope->dataof("//echo/whatToEcho")->value;
      return $str;
      }
      1;
      }

      This looks familiar - did you grab this off of builder.com? :)

      On Tue, 2003-06-10 at 13:25, ggib23 wrote:
      > I am trying to pull info from the Header, at the server level,
      > however I keep getting the following soap fault:
      >
      > <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
      > ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><SOAP-
      > ENV:Fault><faultcode xsi:type="xsd:string">SOAP-
      > ENV:Server</faultcode><faultstring xsi:type="xsd:string">Can't locate
      > object method "dataof" via package "HELLO GEORGE" (perhaps you forgot
      > to load "HELLO GEORGE"?)
      > at /home/bmaccion/apache/htdocs/richard/echo.pl line 33.
      > </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      > Can anyone tell me what I'm doing wrong?
      > Here is client side source code:
      > use SOAP::Lite +trace => "all";
      >
      > $PHRASE = "HELLO GEORGE";
      >
      > my $soap = SOAP::Lite
      > ->readable(1)
      > ->uri('Echo')
      > ->proxy('http://crmdev.hilton.com:9010/richard/echo.pl');
      >
      >
      > my $som = $soap->echo(
      > SOAP::Data->name("whatToEcho" => "$PHRASE"));
      >
      >
      > print "The response from the server was:\n".$som->result."\n";
      >
      > 1;
      >
      >
      > #################################################################
      >
      >
      > Here is the Server side code:
      > use SOAP::Transport::HTTP;
      > use Debug;
      > use Logging;
      > use hilton::Message;
      >
      > Debug::Init( "Gdebug" );
      > Debug::Suffix( ".dbg" );
      > Debug::On();
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Echo')
      > -> handle;
      >
      >
      >
      > package Echo;
      > use strict;
      >
      > use vars qw(@ISA);
      > @ISA = qw(SOAP::Server::Parameters);
      >
      > sub echo
      > {
      > my $self = shift;
      > my $envelope = pop;
      > my $str = $envelope->dataof("//echo/whatToEcho")->value;
      > return $str;
      > }
      >
      > 1;
      >
      >
      > Thanks in advance,
      >
      > Greg Gibson
      >
      >
      >
      > Yahoo! Groups Sponsor
      >
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      --
      Byrne Reese
      Developer Program Manager
      Grand Central Communications
    • Show all 2 messages in this topic