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

2537Re: [soaplite] Can anybody make a client for this un ?

Expand Messages
  • Byrne Reese
    Apr 22, 2003
    • 0 Attachment
      This is really really weird... and tricky. It exposes a lot of the
      configurability of SOAP::Lite, but also a lot of its shortcomings -
      especially in regard to WSDL support, and Schema support.

      Here is my code, and a discussion to follow:
      #!/usr/bin/perl
      #
      # airfare.pl

      # Location of the WSDL file
      my $WSDL ="http://wavendon.dsdata.co.uk:8080/axis/services/SBGGetAirFareQuote?wsdl";
      my $NS = "urn:SBGAirFareQuotes";
      #my $NS = "urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk";
      #my $NS = "http://wavendon.dsdata.co.uk:8080/axis/services/SBGGetAirFareQuote";

      use strict;
      use SOAP::Lite +trace => qw (debug);

      my $search = SOAP::Lite
      ->readable(1)
      ->xmlschema('http://www.w3.org/2001/XMLSchema')
      ->on_action( sub { return '';} )
      ->proxy('http://wavendon.dsdata.co.uk:8080/axis/services/SBGGetAirFareQuote')
      ->uri($NS);

      # CCYY-MM-DDThh:mm:ss
      my $outwardDate = "2003-12-22T00:00:00";
      my $returnDate = "2003-12-30T00:00:00";
      my $origin = "SFO";
      my $destination = "LAX";

      my $results2 = $search->getAirlines();

      my $results =
      $search->getAirFareQuote(
      SOAP::Data->name('outwardDate' => $outwardDate)->type('xsd:dateTime'),
      SOAP::Data->name('returnDate' => $returnDate)->type('xsd:dateTime'),
      SOAP::Data->name('originAirport' => $origin),
      SOAP::Data->name('destinationAirport' => $destination)
      );

      # Loop through the results
      foreach my $result (@{$results->{'result'}}) {
      print $result->{airlineName} . ": " . $result->{fare} . "\n";
      }

      1;

      #<?xml version="1.0" encoding="UTF-8"?>
      #<SOAP-ENV:Envelope
      # xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      # xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      # xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      # xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      # SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      # <SOAP-ENV:Body>
      # <namesp1:getAirFareQuote xmlns:namesp1="urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk">
      # <outwardDate xsi:type="xsd:dateTime">2003-12-22T00:00:00</outwardDate>
      # <returnDate xsi:type="xsd:dateTime">2003-12-30T00:00:00</returnDate>
      # <originAirport xsi:type="xsd:string">SFO</originAirport>
      # <destinationAirport xsi:type="xsd:string">LAX</destinationAirport>
      # </namesp1:getAirFareQuote>
      # </SOAP-ENV:Body>
      #</SOAP-ENV:Envelope>

      DISCUSSION:

      Here is what is weird. I did a lot of digging in the WSDL file and found
      that if I called the service using the following method name then I got
      different error messages: GetAirFareQuoteRequest(params). The errors
      messages were around serialization and what not, which is why I have all
      those tweak calls (i.e. $search->xmlschema, etc).

      However, once I fixed all those faults, then I got the same result back:
      Operation not found for 'GetAirFareQuoteRequest'. So I switch back to
      the proper operation name 'getAirFareQuote' which still throws an error.
      Ironically, other calls to the service works, like getAirlines().

      I would suspect the service, but I have a hard time believing Axis is
      screwing up. But maybe I am too faithful. It is possible they are
      running an older version of Axis. Maybe there is a bug in there.
      Otherwise, I have no friggin' clue, and I can't spend any more time on
      this puppy.

      Please let me know if you resolve it.

      I might try consuming it with .NET or Axis and see if they interact with
      it properly. If you can send me the HTTP/XML stream, I can replicate it
      in SOAP::Lite.


      On Mon, 2003-04-21 at 16:31, iluvperlalot wrote:
      > WSDL :: ->
      > http://wavendon.dsdata.co.uk:8080/axis/services/SBGGetAirFareQuote?wsdl
      >
      > This is what i tried :
      >
      > --------- start code ----------
      > #!perl
      > use SOAP::Lite +trace => [debug => sub {print @_,"\n";}];
      > use Data::Dumper;
      >
      > my $service =
      > SOAP::Lite->service("http://wavendon.dsdata.co.uk:8080/axis/services/SBGGetAirFareQuote?wsdl");
      > my %request =
      > ("outwardDate"=>"12-22-2003","returnDate"=>"12-31-2003","originAirport"=>"LAX",
      > "destinationAirport"=>"JFK
      > ");
      > my $result = $service->getAirFareQuote(%request);
      >
      > print Dumper "$result\n";
      > if (!$result) {
      > print $service->call->faultstring,"\n";
      > }
      >
      > ------------end code------------
      >
      > and i this is what i got (error) ::
      > ... blah blah ..
      >
      > <soapenv:Fault>
      > <faultcode
      > xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.userException</faultcode>
      > <faultstring>org.xml.sax.SAXException: No such operation
      > 'getAirFareQuote'</faultstring>
      > <detail>
      > <ns2:stackTrace
      > xmlns:ns2="http://xml.apache.org/axis/">org.xml.sax.SAXException: No
      > such operation 'getAirFareQuote'
      > at
      > org.apache.axis.message.RPCElement.deserialize(RPCElement.java:224)
      > at
      > org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)
      > at
      > org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:190)
      > ....... blah ..blah..
      >
      >
      > Yahoo! Groups Sponsor
      > ADVERTISEMENT
      >
      >
      > 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 4 messages in this topic