another SOAP related dumb question... [forget - solved]
Code:
#!/usr/bin/ruby
require 'http-access2'
require 'soap/rpc/driver'
require 'soap/driver'
drv = SOAP::RPC::Driver.new('https://192.168.10.191:7071/', 'urn:zimbraAdmin')
drv.wiredump_dev = STDERR #if $DEBUG
drv.options["protocol.http.ssl_config.verify_mode"] = nil
drv.options["protocol.http.basic_auth"] << ['http://192.168.10.191:7071', 'admin@XXXXXX', 'XXXXX']
p drv.add_method('GetAllAdminAccountsRequest')
p drv.GetAllAdminAccountsRequest().call
any hint why the above ruby call returns...
Code:
= Request
! CONNECT TO 192.168.10.191:7071
! CONNECTION ESTABLISHED
at depth 0 - 18: self signed certificate
POST / HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
User-Agent: SOAP4R/1.5.5 (/114, ruby 1.8.3 (2005-09-21) [i686-linux])
Date: Mon Oct 17 17:45:13 WEST 2005
Content-Length: 428
Host: 192.168.10.191:7071
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:GetAllAdminAccountsRequest xmlns:n1="urn:zimbraAdmin"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</n1:GetAllAdminAccountsRequest>
</env:Body>
</env:Envelope>
= Response
HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Expires: Mon, 24 Oct 2005 16:43:22 GMT
Cache-control: max-age:604800, must-revalidate
Set-Cookie: JSESSIONID=F93E54662D82238BAD27208D2025F3E8; Path=/; Secure
Location: https://192.168.10.191:7071/zimbraAdmin
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 0
Date: Mon, 17 Oct 2005 16:43:22 GMT
= Request
POST /zimbraAdmin HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Cookie: JSESSIONID=F93E54662D82238BAD27208D2025F3E8
User-Agent: SOAP4R/1.5.5 (/114, ruby 1.8.3 (2005-09-21) [i686-linux])
Date: Mon Oct 17 17:45:13 WEST 2005
Content-Length: 428
Host: 192.168.10.191:7071
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:GetAllAdminAccountsRequest xmlns:n1="urn:zimbraAdmin"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</n1:GetAllAdminAccountsRequest>
</env:Body>
</env:Envelope>
= Response
HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: https://192.168.10.191:7071/zimbraAdmin/
Transfer-Encoding: chunked
Date: Mon, 17 Oct 2005 16:43:22 GMT
0
= Request
POST /zimbraAdmin/ HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Cookie: JSESSIONID=F93E54662D82238BAD27208D2025F3E8
User-Agent: SOAP4R/1.5.5 (/114, ruby 1.8.3 (2005-09-21) [i686-linux])
Date: Mon Oct 17 17:45:13 WEST 2005
Content-Length: 428
Host: 192.168.10.191:7071
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:GetAllAdminAccountsRequest xmlns:n1="urn:zimbraAdmin"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</n1:GetAllAdminAccountsRequest>
</env:Body>
</env:Envelope>
= Response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Expires: Thu, 3 Nov 2005 17:23:51 GMT
Cache-control: max-age:31536000, must-revalidate
Set-Cookie: JSESSIONID=BCC1B34B6333112258C7640A561B8A8A; Path=/zimbraAdmin; Secure
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Transfer-Encoding: chunked
Date: Mon, 17 Oct 2005 16:43:22 GMT
(...)
and not the expected answer ?
Thanxs in advance.
URL for SOAP is different from UI url.
URL should contain /service/soap/
Code:
drv = SOAP::RPC::Driver.new('https://192.168.10.191:7071/', 'urn:zimbraAdmin')
vs
Code:
drv = SOAP::RPC::Driver.new('https://192.168.10.191:7071/service/soap/', 'urn:zimbraAdmin')
I am almost sure the trailing slash is required (tomcat, not us) - try it with and without.