To connect to the Switch Server, we use SOAP over SSL. First, an SSL connection must be made. The cacert.pem file, located in the Documentation > ssl subfolder of the SDK, contains the root certificate for the SSL connection. The endpoint of the connection is the URL of the Switch Server, e.g. https://localhost:51008 for a Switch Server running on the local machine, using the default port. The port can be changed in the Switch Preferences UI.
Once the connection has been set up, we can test whether we can actually connect to the Switch Server with the CheckConnect SOAP operation:
<soap:Body xmlns:butterfly="http://tempuri.org/butterfly.xsd"> <butterfly:CheckConnect/> </soap:Body>
This call returns a reserved integer if the connection succeeded, e.g.:
<soap:Body xmlns:butterfly="http://tempuri.org/butterfly.xsd"> <butterfly:CheckConnectResponse> <param-1>1</param-1> </butterfly:CheckConnectResponse> </soap:Body>