From: David B. <Dav...@qm...> - 2007-09-14 02:17:16
|
Hi, this patch (below) adds the ability to keep_alive http connections si= mply by putting this at the top of your script: $SOAP::Constants::HTTP_KEEPALIVE =3D 1; The ability to have keep_alive connections is a precursor to using NTLM a= uthentication in the LWP communications. =20 Many Microsoft-enabled intranet web-services use NTLM authentication on t= heir webservices. diff -c /opt/perl-5.8.8/lib/site_perl/5.8.8/SOAP/Transport/HTTP.pm ./SOA= P/Transport/HTTP.pm *** /opt/perl-5.8.8/lib/site_perl/5.8.8/SOAP/Transport/HTTP.pm Fri Jun 1= 6 04:23:28 2006 --- ./SOAP/Transport/HTTP.pm Fri Sep 14 11:58:32 2007 *************** *** 78,84 **** my $class =3D ref($self) || $self; my(@params, @methods); while (@_) { $class->can($_[0]) ? push(@methods, shift() =3D> shift= ) : push(@params, shift) } ! $self =3D $class->SUPER::new(@params); die "SOAP::Transport::HTTP::Client must inherit from LWP::UserAgent= , or one of its subclasses" if !$self->isa("LWP::UserAgent"); $self->agent(join '/', 'SOAP::Lite', 'Perl', SOAP::Transport::HTTP-= >VERSION); --- 78,84 ---- my $class =3D ref($self) || $self; my(@params, @methods); while (@_) { $class->can($_[0]) ? push(@methods, shift() =3D> shift= ) : push(@params, shift) } ! $self =3D $class->SUPER::new(@params,keep_alive =3D> $SOAP::Constan= ts::HTTP_KEEPALIVE); die "SOAP::Transport::HTTP::Client must inherit from LWP::UserAgent= , or one of its subclasses" if !$self->isa("LWP::UserAgent"); $self->agent(join '/', 'SOAP::Lite', 'Perl', SOAP::Transport::HTTP-= >VERSION); $ diff -c /opt/perl-5.8.8/lib/site_perl/5.8.8/SOAP/Lite.pm ./SOAP/Lite.pm *** /opt/perl-5.8.8/lib/site_perl/5.8.8/SOAP/Lite.pm Thu Aug 17 00:49:= 34 2006 --- ./SOAP/Lite.pm Fri Sep 14 11:59:26 2007 *************** *** 340,346 **** $DO_NOT_USE_XML_PARSER $DO_NOT_CHECK_MUSTUNDERSTAND $DO_NOT_USE_CHARSET $DO_NOT_PROCESS_XML_IN_MIME $DO_NOT_USE_LWP_LENGTH_HACK $DO_NOT_CHECK_CONTENT_TYPE ! $MAX_CONTENT_SIZE $PATCH_HTTP_KEEPALIVE $DEFAULT_PACKAGER @SUPPORTED_ENCODING_STYLES $OBJS_BY_REF_KEEPALIVE $DEFAULT_CACHE_TTL ); --- 340,346 ---- $DO_NOT_USE_XML_PARSER $DO_NOT_CHECK_MUSTUNDERSTAND $DO_NOT_USE_CHARSET $DO_NOT_PROCESS_XML_IN_MIME $DO_NOT_USE_LWP_LENGTH_HACK $DO_NOT_CHECK_CONTENT_TYPE ! $MAX_CONTENT_SIZE $PATCH_HTTP_KEEPALIVE $HTTP_KEEPALIVE $= DEFAULT_PACKAGER @SUPPORTED_ENCODING_STYLES $OBJS_BY_REF_KEEPALIVE $DEFAULT_CACHE_TTL ); *************** *** 408,413 **** --- 408,414 ---- $DO_NOT_USE_LWP_LENGTH_HACK =3D 0; $DO_NOT_CHECK_CONTENT_TYPE =3D 0; $PATCH_HTTP_KEEPALIVE =3D 1; + $HTTP_KEEPALIVE =3D 0; $OBJS_BY_REF_KEEPALIVE =3D 600; # seconds # TODO - use default packager constant somewhere $DEFAULT_PACKAGER =3D "SOAP::Packager::MIME"; *************** *** 2894,2900 **** require LWP::UserAgent; $self =3D bless { '_deserializer' =3D> SOAP::Schema::Deserializer->new, ! '_useragent' =3D> LWP::UserAgent->new, } =3D> $class; SOAP::Trace::objects('()'); --- 2895,2901 ---- require LWP::UserAgent; $self =3D bless { '_deserializer' =3D> SOAP::Schema::Deserializer->new, ! '_useragent' =3D> LWP::UserAgent->new(keep_alive =3D> $SOAP::C= onstants::HTTP_KEEPALIVE), } =3D> $class; SOAP::Trace::objects('()'); Thanks. David Bussenschutt IT Business Systems Manager=20 QM Technologies QLD Dav...@qm... ph: 07 3013 5043=20 The message and any attachment is confidential and may be privileged or o= therwise protected from disclosure. If you have received it by mistake pl= ease let us know by reply and then delete it from your system; you should= not copy the message or disclose its contents to anyone. |