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

Re: [soaplite] Macintosh client bug

Expand Messages
  • Paul Kulchenko
    Hi, dpk! ... Bad :)). I know it works, but I would rather do not include it into the distribution. What can be done? Something similar to LWP::Protocol hack
    Message 1 of 6 , Jul 20, 2001
    View Source
    • 0 Attachment
      Hi, dpk!

      > Paul, what are your feelings about specific client workarounds like
      > this?
      Bad :)). I know it works, but I would rather do not include it into
      the distribution. What can be done? Something similar to
      LWP::Protocol hack (in the beginning of HTTP.pm). If inheritance
      can't fix it (and in this case it can't) i would do something like
      this:

      sub patch { local $^W;
      package SOAP::Transport::HTTP::Server;
      my $handle = \&handle; # store original
      *handle = sub {
      my $self = shift->new;
      $self->request->content_type('text/xml')
      if $self->request->content_type eq 'content-type'
      goto &$handle;
      };
      *patch = sub {};
      }

      You need to run it once and it works for all HTTP-based transports
      (you may put it in BEGIN instead of 'sub patch'). You can store it in
      external module and run it right after
      'use SOAP::Transport::HTTP';

      If you want to do it absolutely right ;) and you're basically using
      only one transport class you may do something like that:

      package SOAP::Transport::HTTP::Daemon::Fixed;

      use vars qw(@ISA); @ISA = qw(SOAP::Transport::HTTP::Daemon);

      sub new { patch; shift->SUPER::new(@_) }

      and then just do server code as usual, but use ::Fixed class.

      Let me know how it works for you and thanks for the patch and
      information :)

      Best wishes, Paul.

      --- dpk <beatdown_1_2@...> wrote:
      > There is a bug in the MRJ ( Macintosh Runtime for Java ) which does
      > not
      > supply the correct content-type header when making http requests.
      > This
      > causes interoperability problems when using a macintosh java client
      > (
      > Applet in IE5, for example ) to make SOAP/XMLRPC calls to a server
      > running SOAP::Lite/XMLRPC::Lite . The exact problem is that the
      > Content-type: header is set to 'content-type' instead of 'text/xml'
      > (
      > haha ). Here is a braindead patch, which I dont *really* expect to
      > make
      > it into the distribution, but if anyone is having problems with mac
      > clients using java - this might help.
      >
      > This should work with both 0.50 + 0.51. Apply to
      > SOAP::Transport::HTTP
      > in the main soap dist like so:
      > patch lib/SOAP/Transport/HTTP.pm mac.patch
      >
      > 233a234
      > > $content_type ne 'content-type' && ## Workaround a bug in
      > the
      > Macintosh Java Runtime
      >
      > Ive attached the patch file as well b/c Im not sure if the text
      > above
      > will line wrap or not.
      >
      > Paul, what are your feelings about specific client workarounds like
      > this?
      > dpk
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Get personalized email addresses from Yahoo! Mail
      > http://personal.mail.yahoo.com/
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      > > 233a234
      > > $content_type ne 'content-type' && ## Workaround a bug in
      > the Macintosh Java Runtime
      >


      __________________________________________________
      Do You Yahoo!?
      Get personalized email addresses from Yahoo! Mail
      http://personal.mail.yahoo.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.