<div dir="ltr">Thanks. After testing your one-liner and finding it working (to a degree, more on that in a minute) I moved the hash key/values into the new3 call directly instead of passing "params" as the argument.<div>

<br></div><div style>As for working to a degree. I'm now getting 404 Not Found. I got the same result with the example Perl script. If I navigate to <a href="https://host.example.com/rpc/api">https://host.example.com/rpc/api</a> in a browser I get the same thing.</div>

<div style><br></div><div style>It seems I'm missing something on my server.</div><div style><br></div><div style>Have you ever seen that?</div></div><div class="gmail_extra"><br clear="all"><div>-Mathew<br><br>"When you do things right, people won't be sure you've done anything at all." - God; Futurama<div>

<br></div><div>"<span style="background-color:rgb(255,255,255);font-family:arial,sans-serif;font-size:13px;line-height:18px">We'll get along much better once you accept that you're wrong and neither am I." - Me</span></div>

</div>
<br><br><div class="gmail_quote">On Mon, Apr 22, 2013 at 7:11 PM, Jan Pazdziora <span dir="ltr"><<a href="mailto:jpazdziora@redhat.com" target="_blank">jpazdziora@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On Mon, Apr 22, 2013 at 06:15:51PM +0100, Mathew Snyder wrote:<br>
> I'm trying to connect to the API for our Satellite server. According to<br>
> everything I've read it should be at <a href="https://satellite.example.com/rpc/api" target="_blank">https://satellite.example.com/rpc/api</a>.<br>
> I've tried this using both Ruby and Perl and have received one of two<br>
> errors repeatedly. The first is 404 Not Found and the other is Connection<br>
> refused.<br>
><br>
> I'm not entirely sure how I'm supposed to connect with the xmlrpc/client<br>
> gem in Ruby. This is my code:<br>
><br>
> #!/usr/bin/ruby<br>
><br>
> require "xmlrpc/client"<br>
><br>
> host = "<a href="https://10.153.156.10" target="_blank">https://10.153.156.10</a>"<br>
> hostpath = "<a href="https://10.153.156.10/rpc/api" target="_blank">https://10.153.156.10/rpc/api</a>"<br>
> path = "rpc/api"<br>
> username = "ecapsupport"<br>
> pass = "r310ADed"<br>
><br>
> params = {<br>
>   "host" => "<a href="https://REDACTED" target="_blank">https://REDACTED</a>",<br>
>   "path" => "rpc/api",<br>
>   "port" => "443",<br>
>   "proxy_host" => "",<br>
>   "proxy_port" => "",<br>
>   "user" => "REDACTED",<br>
>   "password" => "REDACTED",<br>
>   "use_ssl" => "true",<br>
>   "timeout" => "300",<br>
> }<br>
><br>
> client = XMLRPC::Client.new3(params)<br>
> client.instance_variable_get(:@http).instance_variable_set(:@verify_mode,<br>
> OpenSSL::SSL::VERIFY_NONE)<br>
><br>
> session = client.call('auth.login', username, pass)<br>
<br>
</div></div>Reading<br>
<br>
        <a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/xmlrpc/rdoc/XMLRPC/Client.html#method-c-new3" target="_blank">http://www.ruby-doc.org/stdlib-2.0/libdoc/xmlrpc/rdoc/XMLRPC/Client.html#method-c-new3</a><br>
<br>
makes me believe that the host is the FQDN of the host, not the<br>
"protocol://FQDN". Thus,<br>
<br>
        ruby -e 'require "xmlrpc/client"; client = XMLRPC::Client.new3({ "host" => "<a href="http://machine.example.com" target="_blank">machine.example.com</a>", "path" => "/rpc/api" }); sys_ver = client.call("api.systemVersion"); puts sys_ver;'<br>


5.5.0<br>
<br>
works just fine for me. Reading the same page reveals that<br>
<br>
        XMLRPC::Client.new_from_uri("<a href="http://machine.example.com/rpc/api" target="_blank">http://machine.example.com/rpc/api</a>");<br>
<br>
works as well, should you prefer to work with URIs. And with the<br>
VERIFY_NONE mode, it even works with https.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jan Pazdziora<br>
Principal Software Engineer, Satellite Engineering, Red Hat<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
</font></span></blockquote></div><br></div>