There are several issues with the script that you provided so that it won't work with Zimbra server
1) As OP stated, the url is incorrect
2) Authentication process is in Zimbra layer not in SSL layer therefore login soap request has to be sent to Zimbra server first to obtain session and token ids.
Here is a rather crude and simple ruby script to issue 'GetAllAdminAccountsRequest'
Hope it helps
Bill
Code:
#!/usr/bin/ruby
require 'soap/rpc/driver'
require 'soap/driver'
require 'soap/header/simplehandler'
class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler
MyHeaderName = XSD::QName.new("urn:zimbra", "context")
def initialize(sessionid = nil, authtoken = nil)
super(MyHeaderName)
@sessionid = sessionid
@authtoken = authtoken
end
def on_simple_outbound
if @sessionid
{ "sessionId" => @sessionid, "authToken" => @authtoken }
end
end
end
drv = SOAP::RPC::Driver.new('https://foo.zimbra.com:7071/service/admin/soap/', 'urn:zimbraAdmin')
drv.wiredump_dev = STDERR #if $DEBUG
drv.options["protocol.http.ssl_config.verify_mode"] = nil
drv.add_method('GetAllAdminAccountsRequest')
drv.add_method('AuthRequest',"name", "password")
token, lifetime, sessionid = drv.AuthRequest('admin@foo.zimbra.com','zimbra')
drv.headerhandler << ClientAuthHeaderHandler.new(sessionid, token)
p drv.GetAllAdminAccountsRequest()