Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

SOAP::Lite or MIME::Entity generate invalid HTTP line endings

by Tardigrade4 (Initiate)
on Nov 11, 2009 at 23:26 UTC ( [id://806606]=perlquestion: print w/replies, xml ) Need Help??

Tardigrade4 has asked for the wisdom of the Perl Monks concerning the following question:

SOAP with Attachments using SOAP::Lite and Mime::Entity do not generate valid HTTP line endings and hence are useless to me. By debugging Axis2 on the receiving end, I can clearly see a "10" (or \n) but never the required new line sequence "13, 10" (or \r\n) required by HTTP.

My client code is right out of the cookbook.

This is true on both Windows and Linux using software and modules I installed today.

Is there a standards-compliance SOAP (including attachments) solution? Is there a better/different package?

  • Comment on SOAP::Lite or MIME::Entity generate invalid HTTP line endings

Replies are listed 'Best First'.
Re: SOAP::Lite or MIME::Entity generate invalid HTTP line endings
by bellaire (Hermit) on Nov 12, 2009 at 00:59 UTC
    Are you using a recent version of SOAP::Lite? It looks like the authors have gone to a lot of trouble to make sure that CRLF is used properly where it's needed. In particular, the most recent copy of the source is definitely reaching into the guts of MIME::Entity to set the boundary delimiter, e.g. in SOAP::Lite::Packager at line 146:
    local $MIME::Entity::BOUNDARY_DELIMITER = "\r\n";
    You can probably try this in your own code if for some reason SOAP::Lite isn't, to make sure that your MIME encodings have the proper line endings.

      The strange thing is that this $MIME::Entity::BOUNDARY_DELIMITER variable isn't being used in MIME::Entity (or anywhere else in the entire MIME-tools package).  In other words, setting it presumably has no effect...

      ...despite this entry in SOAP::Lite's Changes file:

      0.60 Mon Aug 18 12:10:27 2003 ... ! Fixed MIME interoperability bug with Apache Axis - Axis' MIME parser requires that MIME boundaries are terminiated by a CRLF character where the MIME::Tools package only outputs a CR character. A patch was integrated into the MIME::Tools module which allows SOAP::Lite to specify its own MIME Boundary delimiter

      Thank you for replying.

      To be more specific, it is only when I try SOAP with attachments that Axis2 fails to find the \r\n sequence. Normal RPC works nicely. However, I know for a fact that somebody left off a \r, but only when packaging the parts for SOAP with attachments.

      It seems that the bad data is coming from MIME::Entity, which does not use the BOUNDARY_DELIMITER you mention, and has 29 \n characters. Perhaps all of these are illegal.

      My client's expectation is to be able to "perl -MCPAN -e shell" and "install" . I'm new to perl and I would not trust myself to fix something like this (nor would you want me to :-)) , nor would my client expect to pay me to do this. I also am not aware of how ownership of modules works.

      It would be nice to pass along the message.

      It does not look like I'll be doing attachments.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://806606]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found