Can't Connect To API

Discussion in 'General' started by Xendi, Aug 14, 2017.

  1. Xendi

    Xendi New Member

    I'm trying to use the API to manipulate DNS zones. I uploaded the examples folder to on of my sites on the server and edited soap_config.php with my username/password/ip:

    $username = 'user';
    $password = 'password';
    $soap_location = 'http://localhost:8080/ispconfig3_3.0.5/interface/web/remote/index.php';
    $soap_uri = 'http://localhost:8080/ispconfig3_3.0.5/interface/web/remote/';
    $soap_location = '';
    $soap_uri = '';
    I have added the remote user in ISPConfig and given it the permissions I need. I'm getting: SOAP Error: Could not connect to host

    I also tried changing it to https://
    Last edited: Aug 15, 2017
  2. Xendi

    Xendi New Member

    I fixed it by changing my SOAP connection code to:

    $client = new SoapClient(null, array('location' => $soap_location,
    'uri'      => $soap_uri,
    'trace' => 1,
    'stream_context'=> stream_context_create(array('ssl'=> array('verify_peer'=>false,'verify_peer_name'=>false))),
    'exceptions' => 1));

Share This Page