.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XMLRPC::Transport::HTTP 3pm" .TH XMLRPC::Transport::HTTP 3pm "2022-10-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XMLRPC::Transport::HTTP \- Server/Client side HTTP support for XMLRPC::Lite .SH "SYNOPSIS" .IX Header "SYNOPSIS" .IP "Client" 4 .IX Item "Client" .Vb 6 \& use XMLRPC::Lite \& proxy => \*(Aqhttp://localhost/\*(Aq, \& # proxy => \*(Aqhttp://localhost/cgi\-bin/xmlrpc.cgi\*(Aq, # local CGI server \& # proxy => \*(Aqhttp://localhost/\*(Aq, # local daemon server \& # proxy => \*(Aqhttp://login:password@localhost/cgi\-bin/xmlrpc.cgi\*(Aq, # local CGI server with authentication \& ; \& \& print getStateName(1); .Ve .IP "\s-1CGI\s0 server" 4 .IX Item "CGI server" .Vb 1 \& use XMLRPC::Transport::HTTP; \& \& my $server = XMLRPC::Transport::HTTP::CGI \& \-> dispatch_to(\*(AqmethodName\*(Aq) \& \-> handle \& ; .Ve .IP "Daemon server" 4 .IX Item "Daemon server" .Vb 1 \& use XMLRPC::Transport::HTTP; \& \& my $daemon = XMLRPC::Transport::HTTP::Daemon \& \-> new (LocalPort => 80) \& \-> dispatch_to(\*(AqmethodName\*(Aq) \& ; \& print "Contact to XMLRPC server at ", $daemon\->url, "\en"; \& $daemon\->handle; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class encapsulates all \s-1HTTP\s0 related logic for a \s-1XMLRPC\s0 server, independent of what web server it's attached to. If you want to use this class you should follow simple guideline mentioned above. .SS "\s-1PROXY SETTINGS\s0" .IX Subsection "PROXY SETTINGS" You can use any proxy setting you use with LWP::UserAgent modules: .PP .Vb 2 \& XMLRPC::Lite\->proxy(\*(Aqhttp://endpoint.server/\*(Aq, \& proxy => [\*(Aqhttp\*(Aq => \*(Aqhttp://my.proxy.server\*(Aq]); .Ve .PP or .PP .Vb 1 \& $xmlrpc\->transport\->proxy(\*(Aqhttp\*(Aq => \*(Aqhttp://my.proxy.server\*(Aq); .Ve .PP should specify proxy server for you. And if you use \f(CW\*(C`HTTP_proxy_user\*(C'\fR and \f(CW\*(C`HTTP_proxy_pass\*(C'\fR for proxy authorization SOAP::Lite should know how to handle it properly. .SS "COOKIE-BASED \s-1AUTHENTICATION\s0" .IX Subsection "COOKIE-BASED AUTHENTICATION" .Vb 1 \& use HTTP::Cookies; \& \& my $cookies = HTTP::Cookies\->new(ignore_discard => 1); \& # you may also add \*(Aqfile\*(Aq if you want to keep them between sessions \& \& my $xmlrpc = XMLRPC::Lite\->proxy(\*(Aqhttp://localhost/\*(Aq); \& $xmlrpc\->transport\->cookie_jar($cookies); .Ve .PP Cookies will be taken from response and provided for request. You may always add another cookie (or extract what you need after response) with HTTP::Cookies interface. .PP You may also do it in one line: .PP .Vb 2 \& $xmlrpc\->proxy(\*(Aqhttp://localhost/\*(Aq, \& cookie_jar => HTTP::Cookies\->new(ignore_discard => 1)); .Ve .SS "\s-1COMPRESSION\s0" .IX Subsection "COMPRESSION" XMLRPC::Lite provides you option for enabling compression on wire (for \s-1HTTP\s0 transport only). Both server and client should support this capability, but this logic should be absolutely transparent for your application. Server will respond with encoded message only if client can accept it (client sends Accept-Encoding with 'deflate' or '*' values) and client has fallback logic, so if server doesn't understand specified encoding (Content-Encoding: deflate) and returns proper error code (415 \s-1NOT ACCEPTABLE\s0) client will repeat the same request not encoded and will store this server in per-session cache, so all other requests will go there without encoding. .PP Having options on client and server side that let you specify threshold for compression you can safely enable this feature on both client and server side. .PP Compression will be enabled on client side \s-1IF:\s0 threshold is specified \s-1AND\s0 size of current message is bigger than threshold \s-1AND\s0 module Compress::Zlib is available. Client will send header 'Accept\-Encoding' with value 'deflate' if threshold is specified \s-1AND\s0 module Compress::Zlib is available. .PP Server will accept compressed message if module Compress::Zlib is available, and will respond with compressed message \s-1ONLY IF:\s0 threshold is specified \s-1AND\s0 size of current message is bigger than threshold \s-1AND\s0 module Compress::Zlib is available \s-1AND\s0 header 'Accept\-Encoding' is presented in request. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" .Vb 3 \& Crypt::SSLeay for HTTPS/SSL \& HTTP::Daemon for XMLRPC::Transport::HTTP::Daemon \& Apache, Apache::Constants for XMLRPC::Transport::HTTP::Apache .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 2 \& See ::CGI, ::Daemon and ::Apache for implementation details. \& See examples/XMLRPC/* for examples. .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2000\-2001 Paul Kulchenko. All rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" Paul Kulchenko (paulclinger@yahoo.com)