Looking at the source code of SOAP::Packager::MIME, the meat of it seems to be the sub ->package, which adds some headers to the MIME entity and after that calls $top->stringify_body;. So maybe the main trick is to use your own MIME::Entity subclass which has a better ->stringify_body:

package MIME::Entity::Ray; use strict; use parent 'MIME::Entity'; sub stringify_body { my( $self ) = @_; my $body = $self->SUPER::stringify_body(); $body =~ s!\n!\r\n!g; return $body };

And then instead of creating your own MIME::Entity objects create MIME::Entity::Ray objects instead.

If that still fails, maybe something else is creating MIME::Entity objects. Then either edit the source code or monkey patch MIME::Entity:

use MIME::Entity; my $old_stringify_body = \&MIME::Entity::stringify_body; *MIME::Entity::stringify_body = sub { my( $self ) = @_; my $body = $self->SUPER::stringify_body(); $body =~ s!\n!\r\n!g; return $body };

Update: After looking some more at SOAP::Packager, it even tries to do the Right Thing by setting:

local $MIME::Entity::BOUNDARY_DELIMITER = "\r\n";

except that MIME::Entity does not use that variable.

The real solution would be to make MIME::Entity use that variable.


In reply to Re^3: Again on SOAP::Lite, MIME::Entity and SOAP::Packager by Corion
in thread Again on SOAP::Lite, MIME::Entity and SOAP::Packager by ray.rick.mini

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.