Hello,
I would like to develop a java application to store confluence content. I would like to use the XML-RPC API, but i hardly understand how i am supposed to use it.
I tried this code:
import java.net.URL;
import redstone.xmlrpc.XmlRpcFault;
import redstone.xmlrpc.XmlRpcProxy;
public class FIRSTCLASS {
static interface Confluence {
public String login(String username, String password)
throws XmlRpcFault;
public void logout(String loginToken) throws XmlRpcFault;
}
public static void main(String[] args) {
try {
URL url = new URL("https://dev.companyName.com/rpc/xmlrpc/");
Confluence confluence1 = (Confluence) XmlRpcProxy.createProxy(url,
new Class[] { Confluence.class }, true);
String token = confluence1.login("myConfluenceUserName",
"myConfluencePassWord");
confluence1.logout(token);
} catch (Exception e) {
e.printStackTrace();
}
}
}
but I get this exception:
redstone.xmlrpc.XmlRpcException: The response could not be parsed.
at redstone.xmlrpc.XmlRpcClient.handleResponse(Unknown Source)
at redstone.xmlrpc.XmlRpcClient.endCall(Unknown Source)
at redstone.xmlrpc.XmlRpcClient.invoke(Unknown Source)
at redstone.xmlrpc.XmlRpcProxy.invoke(Unknown Source)
at $Proxy0.login(Unknown Source)
at FIRSTCLASS.main(FIRSTCLASS.java:23)
Caused by: java.io.FileNotFoundException: https://dev.companyName/rpc/xmlrpc/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
... 6 more
Community moderators have prevented the ability to post new answers.
Try with this URL instead - https://dev.companyName.com/wiki/rpc/xmlrpc/ (you need the context path "/wiki" as well)
I got the same exception with the wiki/ may it come from a bad instalation of the RPC pugin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, i enventually retried with the added wiki/ (and not wiki// as i did the first time...) and it works. Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.