Hi,
Using Perl, I'm successful calling Confluence.pm rpc-xml commands that don't need 'token' passed it but not with any that require it. Confluence version 3.5.13.
Does anyone know how to get confluence token in format that is valid to pass to confluence API?
Seems certain command on https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs
require an authentication token be passed while for others its actually optional.
Start Perl script by getting a handle to Confluence successfully like:
my $wiki = new Confluence($url, $user, $password); # works fine and so do some other calls to API methods.
# Get Token which according to API is suppossed to return a string:
my $token = $wiki->login($url, $user, $password); # found $URL was required even though API does not show it.
print of token looks like: 'Confluence=HASH(0x1008050b2)' - Which suprisingly matches the printed value of $wiki
# Then use it like:
$bool = $wiki->removeGroup($token, $group);
# Execution Fails and complains about signiture - seems token is interpreted as a string and Hash. Error msg:
REMOTE ERROR: java.lang.NoSuchMethodException: $Proxy737.removeGroup(java.lang.String, java.util.Hashtable, java.lang.String)
Does anyone know how to get confluence token in format that is valid to pass to confluence API?
Community moderators have prevented the ability to post new answers.
> print of token looks like: 'Confluence=HASH(0x1008050b2)'
That's a reference to a hash (ie a map, a dictionary etc).
Try adding at the top:
use Data::Dumper;
then
print Dumper $token
The token is a scalar, so you need to get it out of the hash. Not sure why you're getting a hash but if you post the output from Dumper it should be clear.
Do it like this:
my $confluence = SOAP::Lite->proxy('http://<confluence-page>/rpc/soap-axis/confluenceservice-v1?wsdl');
my $token = $confluence->login($adminuser, $adminpass);
Then, when you need to use the Token on the methods, write this: $token->result()
Cheers...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to both of you, I've been temporarily diverted to another priority and plan to respond to both your replies in the not too distant future.
Thanks,
Craig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello and thank you both for your insight. I've been able to connect and get token and use some of the confluence API using Perl with XMLRPC, XMLRPC calling CLI, and SOAP::LITE.
Does anyone have any Perl/SOAP::LITE examples that work with Confluence API - specifically I'm needing a bit more insight in how to get at the individual fields/values out of what is returned when using for example 'getComment', or 'getComments'.
Thank you and happy Holidays,
Craig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do it like this:
my $confluence = SOAP::Lite->proxy('http://<confluence-page>/rpc/soap-axis/confluenceservice-v1?wsdl');
my $token = $confluence->login($adminuser, $adminpass);
Then, when you need to use the Token on the methods, write this: $token->result()
Cheers...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.