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

Re: hyphens in service function names

Expand Messages
  • eric-amick@comcast.net
    ... I believe you can use something like my $res = $service- call($func); or maybe my $res = $service- call($func = ()); It depends on whether the call()
    Message 1 of 2 , Jun 3, 2004
    • 0 Attachment
      > Has anyone here tried to make use of a web service where the function
      > name for calling the service has a hyphen in it? Some languages (e.g.,
      > Lisp) allow the developer to use hyphens pretty much everywhere. But in
      > Perl, we get for a run on code like this:
      >
      >
      > my $service = SOAP::Lite
      > ->
      > service('file:/net/freddy/data/descriptron_1.1/src/descriptron.wsdl');
      >
      > my $func = 'd-mapper-request';
      >
      > my $res = $service->$func;

      I believe you can use something like

      my $res = $service->call($func);

      or maybe

      my $res = $service->call($func => ());

      It depends on whether the call() method requires both the name of the method to call and an argument list. You may also need to put $func in double quotes--try it without the quotes first.

      --
      Eric Amick
      Columbia, MD


      >
      > There are 2 messages in this issue.
      >
      > Topics in this digest:
      >
      > 1. RE: Serialization
      > From: "Mitchell, Louise M" <Louise.Mitchell@...>
      > 2. hyphens in service function names
      > From: Andrew Dolbey <Andrew.Dolbey@...>
      >
      >
      > ________________________________________________________________________
      > ________________________________________________________________________
      >
      > Message: 1
      > Date: Wed, 02 Jun 2004 12:21:25 -0700
      > From: "Mitchell, Louise M" <Louise.Mitchell@...>
      > Subject: RE: Serialization
      >
      > Here's how I did it... it works... if it's incorrect, someone can
      > comment... 'sXML' is the root tag of my xml... $xml is the inner xml...
      >
      > sub call_via_soap
      > {
      > my $xml = shift;
      >
      > my $soap = SOAP::Lite
      > ->soapversion('1.1')
      > ->uri('http://tempuri.org')
      > ->on_action( sub { join '/', 'http://tempuri.org', $_[1] } )
      >
      > ->proxy('http://ppsdev.pnl.gov/rateestimator/rateestimator.asmx');
      >
      > my $method =
      > SOAP::Data->name('BurdenTransaction')->attr{xmlns=>'http://tempuri.org/'
      > });
      >
      > my $param = SOAP::Data->name(sXML => SOAP::Data->type('string' =>
      > $xml) );
      >
      > my $response = $soap->call($method=>$param);
      >
      > if ($response->fault)
      > {
      > die $response->faultstring;
      > }
      > else
      > {
      > my $result = $response->result;
      > return $result;
      > #my %result = %{$response->result};
      > #print map("$_: @{[$result{$_} || '']}\n", keys %result), "\n";
      > }
      >
      > }
      >
      > -----Original Message-----
      > From: alcurry22 [mailto:andrew.curry@...]
      > Sent: Wednesday, June 02, 2004 4:59 AM
      > To: soaplite@yahoogroups.com
      > Subject: [soaplite] Serialization
      >
      >
      > I have 1gb documents to be passed around using the soap protocol.
      > is it possible to just send the xml as is with out serialization??
      > The only way i can see to do it is SOAP::Data as without this i get
      > rubbish sent, sadly that leaves me with <DATA><DATA></DATA></DATA>
      > which is invalid to the wsdl. Can i just send the xml inside the
      > envelope??
      > Cheers
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      > ________________________________________________________________________
      > ________________________________________________________________________
      >
      > Message: 2
      > Date: Wed, 02 Jun 2004 14:32:22 -0600
      > From: Andrew Dolbey <Andrew.Dolbey@...>
      > Subject: hyphens in service function names
      >
      > Hi all,
      >
      > Has anyone here tried to make use of a web service where the function
      > name for calling the service has a hyphen in it? Some languages (e.g.,
      > Lisp) allow the developer to use hyphens pretty much everywhere. But in
      > Perl, we get for a run on code like this:
      >
      >
      > my $service = SOAP::Lite
      > ->
      > service('file:/net/freddy/data/descriptron_1.1/src/descriptron.wsdl');
      >
      > my $func = 'd-mapper-request';
      >
      > my $res = $service->$func;
      >
      >
      >
      > this sort of response:
      >
      >
      > Bad stub: Bareword "d" not allowed while "strict subs" in use at
      > (eval 86) line 6.
      > Bareword "mapper" not allowed while "strict subs" in use at (eval 86)
      > line 6.
      > at /usr/local/share/perl/5.8.3/SOAP/Lite.pm line 2773
      >
      >
      > I was hoping that having the function name be the value of a scalar
      > variable would keep this from happening. But those hopes were dashed.
      >
      > Anybody have any ideas?
      >
      > Andy
      >
      >
      > [This message contained attachments]
      >
      >
      >
      > ________________________________________________________________________
      > ________________________________________________________________________
      >
      >
      >
      > ------------------------------------------------------------------------
      > Yahoo! Groups Links
      >
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.