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

Re: [soaplite] Problems whith Attachments

Expand Messages
  • Byrne Reese
    Currently, SOAP::MIME overloads SOAP::Lite subroutines and functionality... which admittedly is not the most elegant thing to do. In the next release,
    Message 1 of 1 , Mar 25, 2003
    • 0 Attachment
      Currently, SOAP::MIME overloads SOAP::Lite subroutines and
      functionality... which admittedly is not the most elegant thing to do.
      In the next release, SOAP::MIME will declare its own modules that will
      extend SOAP::Lite as opposed to overloading it. I should have done that
      the first time and honestly am embarrassed that I haven't done it yet.

      In the mean time, here is the workaround:

      The cgi script must use SOAP::Transport::HTTP and SOAP::MIME. For
      example:

      ------------------------------------------
      #!/usr/bin/perl

      use Foo;

      use SOAP::Transport::HTTP;
      use SOAP::MIME;

      SOAP::Transport::HTTP::CGI
      ->dispatch_to('Foo')
      ->handle;
      1;
      ------------------------------------------

      This is because SOAP::MIME overloads subroutines contained within
      SOAP::Transport::HTTP.

      Then in the handler/package ('Foo.pm' in the above example), you MUST
      NOT import/require/use SOAP::Lite or SOAP::MIME again. The context for
      your request has already been established by the cgi script above and
      these modules have already been loaded. Loading them again obviates the
      SOAP::Lite subroutines SOAP::MIME overloaded.

      In the ***NEXT RELEASE***, I will strive to have something that is more
      like the following, which should make everything much more intuitive.

      Eventually SOAP::MIME will be integrated into SOAP::Lite. Eliminating
      the need to import SOAP::MIME at all, and giving SOAP::Lite complete
      MIME support out of the box.

      ------------------------------------------
      #!/usr/bin/perl

      use Foo;

      use SOAP::MIME;

      SOAP::Transport::HTTP::CGI::MIME
      ->dispatch_to('Foo')
      ->handle;
      1;
      ------------------------------------------

      On Tue, 2003-03-25 at 06:32, Pierpaolo Pitocco wrote:
      > Hi,
      > I'm writing a soap client and i've some problem calling a webservice
      > JAVA returnig "n" objects in attachmets.
      > The code i use is the following:
      >
      >
      >
      > eval
      > {
      > $client=SOAP::Lite
      > -> readable(1)
      > -> uri("$INITIALIZED{uri}")
      > -> proxy("$INITIALIZED{url}");
      > };
      > if ($@)
      > {
      > $ERROR++;
      > }
      >
      >
      >
      > $debug=$INITIALIZED{debug};
      > #$debug=0;
      > #$debug==1 && $client->on_debug(sub{print@_});
      >
      > $itemId= SOAP::Data->name("itemId")->type(string=>"$id");
      > $format= SOAP::Data->name("format")->type(string=>"ANY");
      > $sid= SOAP::Data->name("serviceId")->type(string=>"$Sid");
      > $admin= SOAP::Data->name("admin")->type(int=>"0");
      > $full= SOAP::Data->name("full")->type(int=>"1");
      >
      > my $verifica=$client->getItemData($itemId,$sid,$format,$admin,$full);
      > if ($verifica->fault)
      > {
      > my $faultDetail=$verifica->faultdetail;
      > my $faultCode=$verifica->faultcode;
      > my $faultString=$verifica->faultstring;
      > my $faultActor=$verifica->faultactor;
      > my $errorDesc="ERROR ON METHOD pricing OF THE CLASS CMR. ERROR
      > RETURN CODE=ERROR_UNKNOWN\nERROR FAULTCODE=$faultCode\nERROR FAULT
      > DETAIL=$faultDetail\nERROR FAULT STRING=$faultString\nERROR FAULT
      > ACTOR=$faultActor\n";
      > VAS::Logging::errorLog("WWSI_CMR",$errorDesc);
      > return "ERROR=UNKNOWN\n";
      > exit;
      > }
      >
      >
      >
      >
      > foreach my $part (${$verifica->parts}) {
      > print $part->stringify;
      > }
      >
      >
      > The application return me the next error:
      > Can't find 'start' parameter in mulltipart MIME message.
      >
      > .... at /usr/lib/perl......../MIME.pm
      > Could anyone help me?
      > Thanks in advance!
      >
      > /Pitocco
      >
      >
      >
      >
      >
      > Yahoo! Groups Sponsor
      >
      > ADVERTISEMENT
      >
      > <http://rd.yahoo.com/M=246920.2960106.4328965.2848452/D=egroupweb/S=1705
      > 701014:HM/A=1481646/R=0/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_fla
      > ke/g22lp?Target=mm/g22lp.tmpl>
      >
      > <http://us.adserver.yahoo.com/l?M=246920.2960106.4328965.2848452/D=egrou
      > pmail/S=:HM/A=1481646/rand=152957786>
      >
      > 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
      > <http://docs.yahoo.com/info/terms/> .
    Your message has been successfully submitted and would be delivered to recipients shortly.