Search the web
Sign In
New User? Sign Up
soaplite · SOAP::Lite for Perl (soaplite.com)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
MIME attachment mod_perl failed during request deserialization   Message List  
Reply | Forward Message #6342 of 6387 |
Hi all,

I have the following server configuration:

*. Apache/2.2.11 (Ubuntu)
*. mod_perl/2.0.4
*. Perl/v5.10.0
*. SOAP Lite 0.710.08

I am trying to send a MIME::Entity attachment from a client perl script and from .NET  program (using PocketSOAP) to the SOAP Lite server.

Perl client:

(...)

my $ent = MIME::Entity->build(
      Type           => "application/octet-stream",
      Id            => "<$cid>",
      Encoding      => "base64",
      Path          => $filepath,
      Filename      => $filename,
      Disposition => "attachment"
  );

(...)

my $Service = SOAP::Lite->new(
    packer => SOAP::Packager::MIME->new,
    uri    => "urn:myapp:storageservice",
    proxy  => "http://localhost:8880/soap"
);

(...)

$test = $Service->uploadFile(SOAP::Data->name("filePath" => $filepath),
                                                     SOAP::Data->name("file")->attr({href => "cid:$cid"}));

Apache conf:

<Location /soap>
        SetHandler perl-script
        PerlHandler MyAPP::Handler
</Location>

Apache handler:

package MyAPP::Handler;

(...)

my $uri          = 'urn:myapp'

my $server = SOAP::Transport::HTTP::Apache
          ->packager(SOAP::Packager::MIME->new)
          ->dispatch_with({"$uri:storageservice" => 'MyAPP::Storage',
                                           (...)       });

sub handler { $server->handler(@_) }

(...)

Class

package MyAPP::Storage;

(..)

@ISA = qw(Exporter SOAP::Server::Parameters)

(...)

sub uploadFile {
    my $self = shift;
    my $som = pop;

    my $sample   = $som->valueof('//file');
    my $filepath =  $som->valueof('//filepath');

    (...)

    my $uploadFileResult= SOAP::Data->name('uploadFileResult')
                                                                   ->type('string')->value($status);
    return $uploadSampleResult;
}

From SOAP Lite perl client the call fails with the following error message:

(...) <soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Application failed during request deserialization:  syntax error at line 1, column 0, byte 0 at /usr/lib/perl5/XML/Parser.pm line 187
</faultstring></soap:Fault></soap:Body>(...)

From .NET PocketSoap  client the call fails with the following error message:

{"Client : Application failed during request deserialization: \nnot well-formed (invalid token) at line 2, column 7, byte 9 at /usr/lib/perl5/XML/Parser.pm line 187\n"}

-

In the CGI mode all works, same for calls without attachments in both (CGI and mod_perl).

Has anyone successfully sent a MIME attachment from a perl client to an Apache/SOAP Server?

Regards,

Adverick B.


Fri Jul 10, 2009 3:00 pm

adverick.bacon
Offline Offline
Send Email Send Email

Forward
Message #6342 of 6387 |
Expand Messages Author Sort by Date

Hi all, I have the following server configuration: *. Apache/2.2.11 (Ubuntu) *. mod_perl/2.0.4 *. Perl/v5.10.0 *. SOAP Lite 0.710.08 I am trying to send a...
adverick.bacon
Offline Send Email
Jul 10, 2009
3:19 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help