The URL you're using:
$appurl = 'https://www.domain.com/qb/QuickBooks/SOAP/Server.php';
Is not the right URL.
If you reference the quick start guide you'll note that it has to point the Web Connector to this script:
docs/example_web_connector.php
That is the script that should be in your AppURL. The example script is an actual SOAP endpoint which will allow connections from the Web Connector. You've instead pointed the Web Connector to one of the library files which does nothing on it's own, and which you shouldn't need to touch or reference anywhere.
Incidentally, this is also the reason you've had to add that include_once
line as well - you won't need that if you have the Web Connector pointed to the right place.