0

I am using this code to connect server, but get error:

pms.java:25: error: cannot find symbol
server.setconfig(config);
enter code here   ^
  symbol:   method setconfig(XmlRpcClientConfigImpl)
  location: variable server of type XmlRpcClient



import java.util.*;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
//import org.apache.xmlrpc.client.XmlRpcClientConfig;
import org.apache.xmlrpc.common.*;
import org.apache.xmlrpc.*;
import java.net.*;

public class pms {
    public static void main (String [] args) {

        try {
            String UserName = "123";
            String Password = "123";
            String pKey     = "123";
            Vector params = new Vector();
            params.addElement(UserName);
            params.addElement(Password);
            params.addElement(pKey);
            XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
            config.setServerURL(new URL(" https://wubook.net/xrws/"));
            XmlRpcClient server = new XmlRpcClient();
            server.setconfig(config);

            Object result = server.execute("acquire_token",params);

            System.out.println(result);

            System.out.println("Hello World");
        } catch (Exception e) {
            }
    }

}
egorlitvinenko
  • 2,736
  • 2
  • 16
  • 36

2 Answers2

0

i think it should be server.setConfig(config)notserver.setconfig(config)

you can import

import java.net.URL; import java.util.Vector;

import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

only and here is the dependancy

<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-client</artifactId>
<version>3.1.3</version>

it work fine and the output enter image description here

0

Your code server.setcongfig should be setConfig (capitlization)

jr593
  • 287
  • 1
  • 8