{
    "mode": "man",
    "parameter": "make_method",
    "section": "1p",
    "url": "https://www.chedong.com/phpMan.php/man/make_method/1p/json",
    "generated": "2026-11-30T12:55:15Z",
    "synopsis": "makemethod --name=system.identification --helptext='System ID string'\n--signature=string --code=ident.pl --output=ident.xpl\nmakemethod --base=methods/identification",
    "sections": {
        "NAME": {
            "content": "makemethod - Turn Perl code into an XML description for RPC::XML::Server\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "makemethod --name=system.identification --helptext='System ID string'\n--signature=string --code=ident.pl --output=ident.xpl\n\nmakemethod --base=methods/identification\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a simple tool to create the XML descriptive files for specifying methods to be\npublished by an RPC::XML::Server-based server.\n\nIf a server is written such that the methods it exports (or publishes) are a part of the\nrunning code, then there is no need for this tool. However, in cases where the server may be\nseparate and distinct from the code (such as an Apache-based RPC server), specifying the\nroutines and filling in the supporting information can be cumbersome.\n\nOne solution that the RPC::XML::Server package offers is the means to load publishable code\nfrom an external file. The file is in a simple XML dialect that clearly delinates the\nexternally-visible name, the method signatures, the help text and the code itself. These\nfiles may be created manually, or this tool may be used as an aide.\n",
            "subsections": []
        },
        "REQUIRED ARGUMENTS": {
            "content": "There are no required arguments, but if there are not sufficient options passed you will be\ntold by an error message.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The tool recognizes the following options:\n",
            "subsections": [
                {
                    "name": "--help",
                    "content": "Prints a short summary of the options.\n\n--name=STRING\nSpecifies  the  published  name of the method being encoded. This is the name by which it\nwill be visible to clients of the server.\n\n--namespace=STRING\nSpecifies a namespace that the code of the method will be evaluated in, when the XPL file\nis loaded by a server instance.\n\n--type=STRING\nSpecify the type for the resulting file. \"Type\" here refers to whether the container  tag\nused  in  the  resulting XML will specify a procedure or a method. The default is method.\nThe string is treated case-independant, and only the first  character  (\"m\"  or  \"p\")  is\nactually regarded.\n\n--version=STRING\nSpecify a version stamp for the code routine.\n",
                    "long": "--help"
                },
                {
                    "name": "--hidden",
                    "content": "If  this  is passe, the resulting file will include a tag that tells the server daemon to\nnot make the routine visible through any introspection interfaces.\n\n--signature=STRING [ --signature=STRING ... ]\nSpecify one or more signatures for the method. Signatures should be  the  type  names  as\nlaid  out  in  the documentation in RPC::XML, with the elements separated by a colon. You\nmay also separate them with spaces, if  you  quote  the  argument.  This  option  may  be\nspecified more than once, as some methods may have several signatures.\n\n--helptext=STRING\nSpecify  the help text for the method as a simple string on the command line.  Not suited\nfor terribly long help strings.\n\n--helpfile=FILE\nRead the help text for the method from the file specified.\n\n--code=FILE\nRead the actual code for the routine from the file  specified.  If  this  option  is  not\ngiven, the code is read from the standard input file descriptor.\n\n--output=FILE\nWrite  the  resulting  XML  representation  to  the specified file. If this option is not\ngiven, then the output goes to the standard output file descriptor.\n\n--base=NAME\nThis is a special, \"all-in-one\" option. If passed, all other options are ignored.\n\nThe value is used as  the  base  element  for  reading  information  from  a  file  named\nBASE.base.  This  file  will  contain  specification of the name, version, hidden status,\nsignatures and other method information. Each line of the file should look  like  one  of\nthe following:\n\nName: STRING\nSpecify  the  name of the routine being published. If this line does not appear, then\nthe value of the --base argument with all directory elements removed will be used.\n\nVersion: STRING\nProvide a version stamp for the  function.  If  no  line  matching  this  pattern  is\npresent, no version tag will be written.\n\nHidden: STRING\nIf  present,  STRING  should  be either \"yes\" or \"no\" (case not important).  If it is\n\"yes\", then the method is marked to be hidden from any introspection API.\n\nSignature: STRING\nThis line may appear more than once,  and  is  treated  cumulatively.  Other  options\noverride  previous  values  if  they appear more than once. The portion following the\n\"Signature:\" part is taken to be a published signature for the method, with  elements\nseparated  by  whitespace. Each method must have at least one signature, so a lack of\nany will cause an error.\n\nHelpfile: STRING\nSpecifies the file from which to read the help text. It is not an error  if  no  help\ntext is specified.\n\nCodefile: STRING\nSpecifies  the file from which to read the code. Code is assumed to be Perl, and will\nbe tagged as such in the resulting file.\n\nCodefile[lang]: string\nSpecifies the file from which to read code, while also identifying the language  that\nthe  code  is  in.  This allows for the creation of a XPL file that includes multiple\nlanguage implementations of the given method or procedure.\n\nAny other lines than the above patterns are ignored.\n\nIf no code has been read, then the tool will exit with an error message.\n\nThe output is written to BASE.xpl, preserving the path information so that the  resulting\nfile is right alongside the source files. This allows constructs such as:\n\nmakemethod --base=methods/introspection\n",
                    "long": "--hidden"
                }
            ]
        },
        "FILE FORMAT AND DTD": {
            "content": "The  file format for these published routines is a very simple XML dialect.  This is less due\nto XML being an ideal format than it is the  availability  of  the  parser,  given  that  the\nRPC::XML::Server  class  will  already have the parser code in core. Writing a completely new\nformat would not have gained anything.\n\nThe Document Type Declaration for the format can be summarized by:\n\n<!ELEMENT  proceduredef (name, namespace?, version?, hidden?,\nsignature+, help?, code)>\n<!ELEMENT  methoddef  (name, namespace?, version?, hidden?,\nsignature+, help?, code)>\n<!ELEMENT  functiondef (name, namespace?, version?, hidden?,\nsignature+, help?, code)>\n<!ELEMENT  name       (#PCDATA)>\n<!ELEMENT  namespace  (#PCDATA)>\n<!ELEMENT  version    (#PCDATA)>\n<!ELEMENT  hidden     EMPTY>\n<!ELEMENT  signature  (#PCDATA)>\n<!ELEMENT  help       (#PCDATA)>\n<!ELEMENT  code       (#PCDATA)>\n<!ATTLIST  code       language (#PCDATA)>\n\nThe file \"rpc-method.dtd\" that comes with the distribution has some commentary in addition to\nthe actual specification.\n\nA file is (for now) limited to one definition. This is started by the one of the opening tags\n\"<methoddef>\", \"<functiondef>\" or \"<proceduredef>\". This is followed by exactly one  \"<name>\"\ncontainer  specifying  the  method  name,  an  optional version stamp, an optional hide-from-\nintrospection flag, one or more \"<signature>\" containers specifying signatures,  an  optional\n\"<help>\"  container  with  the help text, then the \"<code>\" container with the actual program\ncode. All text should use entity encoding for the symbols:\n\n& C<&amp;> (ampersand)\nE<lt> C<&lt;>  (less-than)\nE<gt> C<&gt;>  (greater-than)\n\nThe parsing process within the server class will decode the entities. To make things  easier,\nthe tool scans all text elements and encodes the above entities before writing the file.\n",
            "subsections": [
                {
                    "name": "The Specification of Code",
                    "content": "This  is  not  \"Programming  101\",  nor  is it \"Perl for the Somewhat Dim\".  The code that is\npassed in via one of the \"*.xpl\" files gets passed to \"eval\" with  next  to  no  modification\n(see  below). Thus, badly-written or malicious code can very well wreak havoc on your server.\nThis is not the fault of the server code. The price of the flexibility this system offers  is\nthe responsibility on the part of the developer to ensure that the code is tested and safe.\n\nCode  itself  is treated as verbatim as possible. Some edits may occur on the server-side, as\nit make the code suitable for creating an anonymous subroutine  from.  The  makemethod  tool\nwill  attempt  to  use  a  \"CDATA\" section to embed the code within the XML document, so that\nthere is no need to encode entities or such. This allows for the resulting *.xpl files to  be\nsyntax-testable  with \"perl -cx\". You can aid this by ensuring that the code does not contain\neither of the two following character sequences:\n\n]]>\n\nDATA\n\nThe first is the \"CDATA\" terminator. If it occurs naturally in the code, it would trigger the\nend-of-section in the parser. The second is the familiar Perl token,  which  is  inserted  so\nthat the remainder of the XML document does not clutter up the Perl parser.\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "The  RPC::XML  distribution  comes  with a number of default methods in a subdirectory called\n(cryptically enough) \"methods\". Each of these is expressed as a set of  (\"*.base\",  \"*.code\",\n\"*.help\")  files.  The Makefile.PL file configures the resulting Makefile such that these are\nused to create \"*.xpl\" files using this tool, and then install them.\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Most problems come out in the form of error messages followed by an abrupt exit.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "The tool exits with a status of 0 upon success, and 255 otherwise.\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "I don't much like this approach to specifying the methods, but I liked my  other  ideas  even\nless.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Please  report  any  bugs or feature requests to \"bug-rpc-xml at rt.cpan.org\", or through the\nweb  interface  at  <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=RPC-XML>.   I   will   be\nnotified,  and  then  you'll  automatically  be  notified  of  progress on your bug as I make\nchanges.\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "•   RT: CPAN's request tracker\n\n<http://rt.cpan.org/NoAuth/Bugs.html?Dist=RPC-XML>\n\n•   AnnoCPAN: Annotated CPAN documentation\n\n<http://annocpan.org/dist/RPC-XML>\n\n•   CPAN Ratings\n\n<http://cpanratings.perl.org/d/RPC-XML>\n\n•   Search CPAN\n\n<http://search.cpan.org/dist/RPC-XML>\n\n•   Source code on GitHub\n\n<http://github.com/rjray/rpc-xml>\n",
            "subsections": []
        },
        "LICENSE AND COPYRIGHT": {
            "content": "This module and the code within are released under the terms  of  the  Artistic  License  2.0\n(http://www.opensource.org/licenses/artistic-license-2.0.php). This code may be redistributed\nunder either the Artistic License or the GNU Lesser General Public License (LGPL) version 2.1\n(http://www.opensource.org/licenses/lgpl-2.1.php).\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "RPC::XML, RPC::XML::Server\n",
            "subsections": []
        },
        "CREDITS": {
            "content": "The   XML-RPC   standard   is   Copyright   (c)   1998-2001,  UserLand  Software,  Inc.   See\n<http://www.xmlrpc.com> for more information about the XML-RPC specification.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Randy J. Ray <rjray@blackperl.com>\n\nperl v5.32.0                                 2021-01-10                              MAKEMETHOD(1p)",
            "subsections": []
        }
    },
    "summary": "makemethod - Turn Perl code into an XML description for RPC::XML::Server",
    "flags": [
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Prints a short summary of the options. --name=STRING Specifies the published name of the method being encoded. This is the name by which it will be visible to clients of the server. --namespace=STRING Specifies a namespace that the code of the method will be evaluated in, when the XPL file is loaded by a server instance. --type=STRING Specify the type for the resulting file. \"Type\" here refers to whether the container tag used in the resulting XML will specify a procedure or a method. The default is method. The string is treated case-independant, and only the first character (\"m\" or \"p\") is actually regarded. --version=STRING Specify a version stamp for the code routine."
        },
        {
            "flag": "",
            "long": "--hidden",
            "arg": null,
            "description": "If this is passe, the resulting file will include a tag that tells the server daemon to not make the routine visible through any introspection interfaces. --signature=STRING [ --signature=STRING ... ] Specify one or more signatures for the method. Signatures should be the type names as laid out in the documentation in RPC::XML, with the elements separated by a colon. You may also separate them with spaces, if you quote the argument. This option may be specified more than once, as some methods may have several signatures. --helptext=STRING Specify the help text for the method as a simple string on the command line. Not suited for terribly long help strings. --helpfile=FILE Read the help text for the method from the file specified. --code=FILE Read the actual code for the routine from the file specified. If this option is not given, the code is read from the standard input file descriptor. --output=FILE Write the resulting XML representation to the specified file. If this option is not given, then the output goes to the standard output file descriptor. --base=NAME This is a special, \"all-in-one\" option. If passed, all other options are ignored. The value is used as the base element for reading information from a file named BASE.base. This file will contain specification of the name, version, hidden status, signatures and other method information. Each line of the file should look like one of the following: Name: STRING Specify the name of the routine being published. If this line does not appear, then the value of the --base argument with all directory elements removed will be used. Version: STRING Provide a version stamp for the function. If no line matching this pattern is present, no version tag will be written. Hidden: STRING If present, STRING should be either \"yes\" or \"no\" (case not important). If it is \"yes\", then the method is marked to be hidden from any introspection API. Signature: STRING This line may appear more than once, and is treated cumulatively. Other options override previous values if they appear more than once. The portion following the \"Signature:\" part is taken to be a published signature for the method, with elements separated by whitespace. Each method must have at least one signature, so a lack of any will cause an error. Helpfile: STRING Specifies the file from which to read the help text. It is not an error if no help text is specified. Codefile: STRING Specifies the file from which to read the code. Code is assumed to be Perl, and will be tagged as such in the resulting file. Codefile[lang]: string Specifies the file from which to read code, while also identifying the language that the code is in. This allows for the creation of a XPL file that includes multiple language implementations of the given method or procedure. Any other lines than the above patterns are ignored. If no code has been read, then the tool will exit with an error message. The output is written to BASE.xpl, preserving the path information so that the resulting file is right alongside the source files. This allows constructs such as: makemethod --base=methods/introspection"
        }
    ],
    "examples": [
        "The  RPC::XML  distribution  comes  with a number of default methods in a subdirectory called",
        "(cryptically enough) \"methods\". Each of these is expressed as a set of  (\"*.base\",  \"*.code\",",
        "\"*.help\")  files.  The Makefile.PL file configures the resulting Makefile such that these are",
        "used to create \"*.xpl\" files using this tool, and then install them."
    ],
    "see_also": [],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}