"Fossies" - the Fresh Open Source Software Archive

Member "phpgroupware-0.9.16.017/xmlrpc/doc/xmlrpcmsg.html" (7 Aug 2001, 6413 Bytes) of package /linux/www/old/phpgroupware-0.9.16.017.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <HTML
    2 ><HEAD
    3 ><TITLE
    4 >xmlrpcmsg</TITLE
    5 ><META
    6 NAME="GENERATOR"
    7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
    8 "><LINK
    9 REV="MADE"
   10 HREF="edd@usefulinc.com"><LINK
   11 REL="HOME"
   12 TITLE="XML-RPC for PHP"
   13 HREF="index.html"><LINK
   14 REL="UP"
   15 TITLE="Class documentation"
   16 HREF="apidocs.html"><LINK
   17 REL="PREVIOUS"
   18 TITLE="Class documentation"
   19 HREF="apidocs.html"><LINK
   20 REL="NEXT"
   21 TITLE="xmlrpcresp"
   22 HREF="xmlrpcresp.html"></HEAD
   23 ><BODY
   24 CLASS="SECT1"
   25 BGCOLOR="#FFFFFF"
   26 TEXT="#000000"
   27 LINK="#0000FF"
   28 VLINK="#840084"
   29 ALINK="#0000FF"
   30 ><DIV
   31 CLASS="NAVHEADER"
   32 ><TABLE
   33 WIDTH="100%"
   34 BORDER="0"
   35 CELLPADDING="0"
   36 CELLSPACING="0"
   37 ><TR
   38 ><TH
   39 COLSPAN="3"
   40 ALIGN="center"
   41 >XML-RPC for PHP: version 1.0b9</TH
   42 ></TR
   43 ><TR
   44 ><TD
   45 WIDTH="10%"
   46 ALIGN="left"
   47 VALIGN="bottom"
   48 ><A
   49 HREF="apidocs.html"
   50 >Prev</A
   51 ></TD
   52 ><TD
   53 WIDTH="80%"
   54 ALIGN="center"
   55 VALIGN="bottom"
   56 >Chapter 5. Class documentation</TD
   57 ><TD
   58 WIDTH="10%"
   59 ALIGN="right"
   60 VALIGN="bottom"
   61 ><A
   62 HREF="xmlrpcresp.html"
   63 >Next</A
   64 ></TD
   65 ></TR
   66 ></TABLE
   67 ><HR
   68 ALIGN="LEFT"
   69 WIDTH="100%"></DIV
   70 ><DIV
   71 CLASS="SECT1"
   72 ><H1
   73 CLASS="SECT1"
   74 ><A
   75 NAME="XMLRPCMSG"
   76 >xmlrpcmsg</A
   77 ></H1
   78 ><P
   79 >This class provides a representation for a request to an
   80         XML-RPC server. A client sends an
   81         <TT
   82 CLASS="CLASSNAME"
   83 >xmlrpcmsg</TT
   84 > to a server, and receives back
   85         an <TT
   86 CLASS="CLASSNAME"
   87 >xmlrpcresp</TT
   88 > (see <A
   89 HREF="apidocs.html#XMLRPC-CLIENT-SEND"
   90 >xmlrpc_client-&#62;send</A
   91 >).</P
   92 ><DIV
   93 CLASS="SECT2"
   94 ><H2
   95 CLASS="SECT2"
   96 ><A
   97 NAME="AEN238"
   98 >Creation</A
   99 ></H2
  100 ><P
  101 >The constructor takes the following form:</P
  102 ><DIV
  103 CLASS="FUNCSYNOPSIS"
  104 ><A
  105 NAME="AEN241"
  106 ></A
  107 ><P
  108 ></P
  109 ><P
  110 ><CODE
  111 ><CODE
  112 CLASS="FUNCDEF"
  113 >$msg=new xmlrpcmsg</CODE
  114 >($methodName, $parameterArray);</CODE
  115 ></P
  116 ><P
  117 ></P
  118 ></DIV
  119 ><P
  120 >Where <TT
  121 CLASS="PARAMETER"
  122 ><I
  123 >$methodName</I
  124 ></TT
  125 > is a string
  126           indicating the name of the method you wish to invoke, and
  127           <TT
  128 CLASS="PARAMETER"
  129 ><I
  130 >$parameterArray</I
  131 ></TT
  132 > is a simple
  133           <TT
  134 CLASS="CLASSNAME"
  135 >Array</TT
  136 > of
  137           <TT
  138 CLASS="CLASSNAME"
  139 >xmlrpcval</TT
  140 > objects.  Here's an example
  141           message to the <I
  142 CLASS="EMPHASIS"
  143 >US state name</I
  144 > server:
  145         </P
  146 ><PRE
  147 CLASS="PROGRAMLISTING"
  148 >$msg=new xmlrpcmsg("examples.getStateName",
  149           array(new xmlrpcval(23, "int")));
  150         </PRE
  151 ><P
  152 >         This example requests the name of state number 23. For more
  153           information on <TT
  154 CLASS="CLASSNAME"
  155 >xmlrpcval</TT
  156 > objects, see
  157           <A
  158 HREF="xmlrpcval.html"
  159 >xmlrpcval</A
  160 >.
  161         </P
  162 ></DIV
  163 ><DIV
  164 CLASS="SECT2"
  165 ><H2
  166 CLASS="SECT2"
  167 ><A
  168 NAME="AEN258"
  169 >Methods</A
  170 ></H2
  171 ><DIV
  172 CLASS="SECT3"
  173 ><H3
  174 CLASS="SECT3"
  175 ><A
  176 NAME="AEN260"
  177 >serialize</A
  178 ></H3
  179 ><DIV
  180 CLASS="FUNCSYNOPSIS"
  181 ><A
  182 NAME="AEN262"
  183 ></A
  184 ><P
  185 ></P
  186 ><P
  187 ><CODE
  188 ><CODE
  189 CLASS="FUNCDEF"
  190 >$outString=$msg-&#62;serialize</CODE
  191 >();</CODE
  192 ></P
  193 ><P
  194 ></P
  195 ></DIV
  196 ><P
  197 >Returns the an XML string representing the XML-RPC
  198             message.</P
  199 ></DIV
  200 ><DIV
  201 CLASS="SECT3"
  202 ><H3
  203 CLASS="SECT3"
  204 ><A
  205 NAME="AEN267"
  206 >addParam</A
  207 ></H3
  208 ><DIV
  209 CLASS="FUNCSYNOPSIS"
  210 ><A
  211 NAME="AEN269"
  212 ></A
  213 ><P
  214 ></P
  215 ><P
  216 ><CODE
  217 ><CODE
  218 CLASS="FUNCDEF"
  219 >$msg-&#62;addParam</CODE
  220 >($xmlrpcVal);</CODE
  221 ></P
  222 ><P
  223 ></P
  224 ></DIV
  225 ><P
  226 >Adds the <TT
  227 CLASS="CLASSNAME"
  228 >xmlrpcval</TT
  229 >
  230             <TT
  231 CLASS="PARAMETER"
  232 ><I
  233 >$xmlrpcVal</I
  234 ></TT
  235 > to the parameter list for
  236             this method call.</P
  237 ></DIV
  238 ><DIV
  239 CLASS="SECT3"
  240 ><H3
  241 CLASS="SECT3"
  242 ><A
  243 NAME="AEN277"
  244 >getParam</A
  245 ></H3
  246 ><DIV
  247 CLASS="FUNCSYNOPSIS"
  248 ><A
  249 NAME="AEN279"
  250 ></A
  251 ><P
  252 ></P
  253 ><P
  254 ><CODE
  255 ><CODE
  256 CLASS="FUNCDEF"
  257 >$xmlrpcVal=$msg-&#62;getParam</CODE
  258 >($n);</CODE
  259 ></P
  260 ><P
  261 ></P
  262 ></DIV
  263 ><P
  264 >Gets the <TT
  265 CLASS="PARAMETER"
  266 ><I
  267 >$n</I
  268 ></TT
  269 >th parameter in the
  270             message. Use this method in server implementations. Returns
  271             the <TT
  272 CLASS="LITERAL"
  273 >undef</TT
  274 > value if no such parameter
  275             exists.</P
  276 ></DIV
  277 ><DIV
  278 CLASS="SECT3"
  279 ><H3
  280 CLASS="SECT3"
  281 ><A
  282 NAME="AEN287"
  283 >getNumParams</A
  284 ></H3
  285 ><DIV
  286 CLASS="FUNCSYNOPSIS"
  287 ><A
  288 NAME="AEN289"
  289 ></A
  290 ><P
  291 ></P
  292 ><P
  293 ><CODE
  294 ><CODE
  295 CLASS="FUNCDEF"
  296 >$n=$msg-&#62;getNumParams</CODE
  297 >();</CODE
  298 ></P
  299 ><P
  300 ></P
  301 ></DIV
  302 ><P
  303 >           Returns the number of parameters attached to this message.
  304           </P
  305 ></DIV
  306 ><DIV
  307 CLASS="SECT3"
  308 ><H3
  309 CLASS="SECT3"
  310 ><A
  311 NAME="AEN294"
  312 >method</A
  313 ></H3
  314 ><DIV
  315 CLASS="FUNCSYNOPSIS"
  316 ><A
  317 NAME="AEN296"
  318 ></A
  319 ><P
  320 ></P
  321 ><P
  322 ><CODE
  323 ><CODE
  324 CLASS="FUNCDEF"
  325 >$methName=$msg-&#62;method</CODE
  326 >();</CODE
  327 ></P
  328 ><P
  329 ><CODE
  330 ><CODE
  331 CLASS="FUNCDEF"
  332 >$msg-&#62;method</CODE
  333 >($methName);</CODE
  334 ></P
  335 ><P
  336 ></P
  337 ></DIV
  338 ><P
  339 >Gets or sets the method contained in the XML-RPC message.</P
  340 ></DIV
  341 ><DIV
  342 CLASS="SECT3"
  343 ><H3
  344 CLASS="SECT3"
  345 ><A
  346 NAME="AEN305"
  347 >parseResponse</A
  348 ></H3
  349 ><DIV
  350 CLASS="FUNCSYNOPSIS"
  351 ><A
  352 NAME="AEN307"
  353 ></A
  354 ><P
  355 ></P
  356 ><P
  357 ><CODE
  358 ><CODE
  359 CLASS="FUNCDEF"
  360 >$response=$msg-&#62;parseResponse</CODE
  361 >($xmlString);</CODE
  362 ></P
  363 ><P
  364 ></P
  365 ></DIV
  366 ><P
  367 >Given an incoming XML-RPC server response contained in
  368             the string
  369             <TT
  370 CLASS="PARAMETER"
  371 ><I
  372 >$xmlString</I
  373 ></TT
  374 >, this method constructs
  375             an <TT
  376 CLASS="CLASSNAME"
  377 >xmlrpcresp</TT
  378 > response object and
  379             returns it, setting error codes as appropriate (see <A
  380 HREF="apidocs.html#XMLRPC-CLIENT-SEND"
  381 >xmlrpc_client-&#62;send</A
  382 >).
  383           </P
  384 ><P
  385 >           This method processes any HTTP/MIME headers it finds.
  386           </P
  387 ></DIV
  388 ><DIV
  389 CLASS="SECT3"
  390 ><H3
  391 CLASS="SECT3"
  392 ><A
  393 NAME="AEN317"
  394 >parseResponseFile</A
  395 ></H3
  396 ><DIV
  397 CLASS="FUNCSYNOPSIS"
  398 ><A
  399 NAME="AEN319"
  400 ></A
  401 ><P
  402 ></P
  403 ><P
  404 ><CODE
  405 ><CODE
  406 CLASS="FUNCDEF"
  407 >$response=$msg-&#62;parseResponseFile</CODE
  408 >($fileHandle);</CODE
  409 ></P
  410 ><P
  411 ></P
  412 ></DIV
  413 ><P
  414 >Given an incoming XML-RPC server response on the file handle
  415             <TT
  416 CLASS="PARAMETER"
  417 ><I
  418 >$fileHandle</I
  419 ></TT
  420 >, this method reads the
  421             data and passes it to <TT
  422 CLASS="FUNCTION"
  423 >parseResponse</TT
  424 >
  425           </P
  426 ><P
  427 >           This method is useful to construct responses from
  428             pre-prepared files (see files <TT
  429 CLASS="LITERAL"
  430 >demo1.txt, demo2.txt, 
  431               demo3.txt</TT
  432 > in this distribution). It processes
  433             any HTTP headers it finds.
  434           </P
  435 ></DIV
  436 ></DIV
  437 ></DIV
  438 ><DIV
  439 CLASS="NAVFOOTER"
  440 ><HR
  441 ALIGN="LEFT"
  442 WIDTH="100%"><TABLE
  443 WIDTH="100%"
  444 BORDER="0"
  445 CELLPADDING="0"
  446 CELLSPACING="0"
  447 ><TR
  448 ><TD
  449 WIDTH="33%"
  450 ALIGN="left"
  451 VALIGN="top"
  452 ><A
  453 HREF="apidocs.html"
  454 >Prev</A
  455 ></TD
  456 ><TD
  457 WIDTH="34%"
  458 ALIGN="center"
  459 VALIGN="top"
  460 ><A
  461 HREF="index.html"
  462 >Home</A
  463 ></TD
  464 ><TD
  465 WIDTH="33%"
  466 ALIGN="right"
  467 VALIGN="top"
  468 ><A
  469 HREF="xmlrpcresp.html"
  470 >Next</A
  471 ></TD
  472 ></TR
  473 ><TR
  474 ><TD
  475 WIDTH="33%"
  476 ALIGN="left"
  477 VALIGN="top"
  478 >Class documentation</TD
  479 ><TD
  480 WIDTH="34%"
  481 ALIGN="center"
  482 VALIGN="top"
  483 ><A
  484 HREF="apidocs.html"
  485 >Up</A
  486 ></TD
  487 ><TD
  488 WIDTH="33%"
  489 ALIGN="right"
  490 VALIGN="top"
  491 >xmlrpcresp</TD
  492 ></TR
  493 ></TABLE
  494 ></DIV
  495 ></BODY
  496 ></HTML
  497 >