List Info

Thread: Created: (XMLRPC-108) Many broken code examples in the documentation




Created: (XMLRPC-108) Many broken code examples in the documentation
user name
2006-08-25 17:35:25
Many broken code examples in the documentation
----------------------------------------------

                 Key: XMLRPC-108
                 URL: http:
//issues.apache.org/jira/browse/XMLRPC-108
             Project: XML-RPC
          Issue Type: Bug
          Components: Source, Website
    Affects Versions: 3.0rc1
            Reporter: Catalin Hritcu
            Priority: Minor
         Attachments: xmlrpc3-doc.patch

Had to learn to use xmlrpc these days, and the good
documentation helped a lot. However, many of the code
examples on the website and in the java-docs won't even
compile - outdated. They are mostly minor glitches but still
annoying. Here are some examples I can remember:

http://ws.apache.org/xmlrpc/apidoc
s/org/apache/xmlrpc/webserver/WebServer.html

   final int portNumber = 8088;
   final String propertyFile =
"MyHandler.properties";

   PropertyHandlerMapping mapping = new
PropertyHandlerMapping();
   ClassLoader cl =
Thread.currentThread().getContextClassLoader();
   mapping.load(cl, propertyFile);
   WebServer webServer = new WebServer(port);
   XmlRpcServerConfigImpl config = new
XmlRpcServerConfigImpl();
   XmlRpcServer server = server.getXmlRpcServer();
   server.setConfig(config);
   server.setHandlerMapping(mapping);
   server.start();

- "port" should be "portNumber"
- "server.getXmlRpcServer()" should be
"webServer..getXmlRpcServer()"
- "server.start()" should be
"webServer.start()"


http://ws.apache.org/xmlrpc
/apidocs/org/apache/xmlrpc/webserver/ServletWebServer.html

        final int portNumber = 8088;

        ClassLoader cl =
Thread.currentThread().getContextClassLoader();
        XmlRpcServlet servlet = new XmlRpcServlet();
        ServletWebServer webServer = new
ServletWebServer(servlet, port);
        webServer.start();

- "port" should be "portNumber"
- "cl" is never used


http://ws.apa
che.org/xmlrpc/client.html

    XmlRpcClientConfigImpl config = new
XmlRpcClientConfigImpl();
    config.setServerUrl("http://127.0.0.1:
8080/XmlRpcServlet");
    XmlRpcClient client = new XmlRpcClient();
    client.setTransportFactory(new
XmlRpcCommonsTransportFactory());
    client.setConfig(config);
    Object[] params = new Object[]{new Integer(2), new
Integer(3)};
    Integer result = (Integer)
client.execute("Calculator.add", params);

- "config.setServerUrl("http://127.0.0.1:8080/xm
lrpc");" should be
"config.setServerURL(new URL("http://127.0.0.1:8080/xm
lrpc"));"
- "new XmlRpcCommonsTransportFactory()" should
be "new XmlRpcCommonsTransportFactory(client)"


There are probably more lurking around. For the ones I knew
how to fix I attached a patch (). What I couldn't fix was:
http://ws.apa
che.org/xmlrpc/server.html -> Basic Authentication -
since PropertyHandlerMapping.newXmlRpcHandlerMapping no
longer exists.

PS: I grant license to ASF for inclusion in ASF works (as
per the Apache Software License §5) ... the create issue
form is broken and won't ask about this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/jira/secure/Administrators.jspa

-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

       
Resolved: (XMLRPC-108) Many broken code examples in the documentation
user name
2006-08-25 21:07:23
     [ http://issues.apache.org/jira/browse/XMLRPC-108?page=all
 ]

Jochen Wiedmann resolved XMLRPC-108.
------------------------------------

    Fix Version/s: 3.0
       Resolution: Fixed

Applied, thank you!


> Many broken code examples in the documentation
> ----------------------------------------------
>
>                 Key: XMLRPC-108
>                 URL: http:
//issues.apache.org/jira/browse/XMLRPC-108
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source, Website
>    Affects Versions: 3.0rc1
>            Reporter: Catalin Hritcu
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: xmlrpc3-doc.patch
>
>
> Had to learn to use xmlrpc these days, and the good
documentation helped a lot. However, many of the code
examples on the website and in the java-docs won't even
compile - outdated. They are mostly minor glitches but still
annoying. Here are some examples I can remember:
> http://ws.apache.org/xmlrpc/apidoc
s/org/apache/xmlrpc/webserver/WebServer.html
>    final int portNumber = 8088;
>    final String propertyFile =
"MyHandler.properties";
>    PropertyHandlerMapping mapping = new
PropertyHandlerMapping();
>    ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>    mapping.load(cl, propertyFile);
>    WebServer webServer = new WebServer(port);
>    XmlRpcServerConfigImpl config = new
XmlRpcServerConfigImpl();
>    XmlRpcServer server = server.getXmlRpcServer();
>    server.setConfig(config);
>    server.setHandlerMapping(mapping);
>    server.start();
> - "port" should be "portNumber"
> - "server.getXmlRpcServer()" should be
"webServer..getXmlRpcServer()"
> - "server.start()" should be
"webServer.start()"
> http://ws.apache.org/xmlrpc
/apidocs/org/apache/xmlrpc/webserver/ServletWebServer.html
>         final int portNumber = 8088;
>         ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>         XmlRpcServlet servlet = new XmlRpcServlet();
>         ServletWebServer webServer = new
ServletWebServer(servlet, port);
>         webServer.start();
> - "port" should be "portNumber"
> - "cl" is never used
> http://ws.apa
che.org/xmlrpc/client.html
>     XmlRpcClientConfigImpl config = new
XmlRpcClientConfigImpl();
>     config.setServerUrl("http://127.0.0.1:
8080/XmlRpcServlet");
>     XmlRpcClient client = new XmlRpcClient();
>     client.setTransportFactory(new
XmlRpcCommonsTransportFactory());
>     client.setConfig(config);
>     Object[] params = new Object[]{new Integer(2), new
Integer(3)};
>     Integer result = (Integer)
client.execute("Calculator.add", params);
> - "config.setServerUrl("http://127.0.0.1:8080/xm
lrpc");" should be
"config.setServerURL(new URL("http://127.0.0.1:8080/xm
lrpc"));"
> - "new XmlRpcCommonsTransportFactory()"
should be "new
XmlRpcCommonsTransportFactory(client)"
> There are probably more lurking around. For the ones I
knew how to fix I attached a patch (). What I couldn't fix
was:
> http://ws.apa
che.org/xmlrpc/server.html -> Basic Authentication -
since PropertyHandlerMapping.newXmlRpcHandlerMapping no
longer exists.
> PS: I grant license to ASF for inclusion in ASF works
(as per the Apache Software License §5) ... the create
issue form is broken and won't ask about this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/jira/secure/Administrators.jspa

-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

       
Closed: (XMLRPC-108) Many broken code examples in the documentation
user name
2006-10-05 20:58:27
     [ http://issues.apache.org/jira/browse/XMLRPC-108?page=all
 ]

Jochen Wiedmann closed XMLRPC-108.
----------------------------------


> Many broken code examples in the documentation
> ----------------------------------------------
>
>                 Key: XMLRPC-108
>                 URL: http:
//issues.apache.org/jira/browse/XMLRPC-108
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source, Website
>    Affects Versions: 3.0rc1
>            Reporter: Catalin Hritcu
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: xmlrpc3-doc.patch
>
>
> Had to learn to use xmlrpc these days, and the good
documentation helped a lot. However, many of the code
examples on the website and in the java-docs won't even
compile - outdated. They are mostly minor glitches but still
annoying. Here are some examples I can remember:
> http://ws.apache.org/xmlrpc/apidoc
s/org/apache/xmlrpc/webserver/WebServer.html
>    final int portNumber = 8088;
>    final String propertyFile =
"MyHandler.properties";
>    PropertyHandlerMapping mapping = new
PropertyHandlerMapping();
>    ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>    mapping.load(cl, propertyFile);
>    WebServer webServer = new WebServer(port);
>    XmlRpcServerConfigImpl config = new
XmlRpcServerConfigImpl();
>    XmlRpcServer server = server.getXmlRpcServer();
>    server.setConfig(config);
>    server.setHandlerMapping(mapping);
>    server.start();
> - "port" should be "portNumber"
> - "server.getXmlRpcServer()" should be
"webServer..getXmlRpcServer()"
> - "server.start()" should be
"webServer.start()"
> http://ws.apache.org/xmlrpc
/apidocs/org/apache/xmlrpc/webserver/ServletWebServer.html
>         final int portNumber = 8088;
>         ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>         XmlRpcServlet servlet = new XmlRpcServlet();
>         ServletWebServer webServer = new
ServletWebServer(servlet, port);
>         webServer.start();
> - "port" should be "portNumber"
> - "cl" is never used
> http://ws.apa
che.org/xmlrpc/client.html
>     XmlRpcClientConfigImpl config = new
XmlRpcClientConfigImpl();
>     config.setServerUrl("http://127.
0.0.1:8080/XmlRpcServlet");
>     XmlRpcClient client = new XmlRpcClient();
>     client.setTransportFactory(new
XmlRpcCommonsTransportFactory());
>     client.setConfig(config);
>     Object[] params = new Object[]{new Integer(2), new
Integer(3)};
>     Integer result = (Integer)
client.execute("Calculator.add", params);
> - "config.setServerUrl("http://127.0.0.1:8
080/xmlrpc");" should be
"config.setServerURL(new URL("http://127.0.0.1:8
080/xmlrpc"));"
> - "new XmlRpcCommonsTransportFactory()"
should be "new
XmlRpcCommonsTransportFactory(client)"
> There are probably more lurking around. For the ones I
knew how to fix I attached a patch (). What I couldn't fix
was:
> http://ws.apa
che.org/xmlrpc/server.html -> Basic Authentication -
since PropertyHandlerMapping.newXmlRpcHandlerMapping no
longer exists.
> PS: I grant license to ASF for inclusion in ASF works
(as per the Apache Software License §5) ... the create
issue form is broken and won't ask about this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/jira/secure/Administrators.jspa

-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

       
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )