Webservices API Manual
2
2.1 Access
To access the interface, choose a programming language or software package that supports
client consumption of a WSDL which is protected by WSE 2.0. By default C# allows easy and
reliable access to BackupAgent WebServices. Following step-by-step instructions show how to
access BackupAgent WebServices.
1. Find the WSDL. In the normal case the WSDL is provided on an url like
‘https://yourdomain.com/CloudBackupService/BackupService.asmx?WSDL’
2. Create a proxy class to represent the WebService. In C# this proxy class is called a ‘web
reference’.
3. Derive the proxy class from the Microsoft.Web.Services2.WebServicesClientProtocol
4. Attach a UsernameToken to object references based on the client proxy class using the
RequestSoapContext.Security.Tokens collection. Add a MessageSignature based on the
UsernameToken to the RequestSoapContext.Security.Elements collection.
5. Login for user/administrator access calling the CheckUserLogin function.
Important: Use the URL where the license is installed on. Otherwise you will receive a license
error.
The UsernameToken must be based on an existing username/password combination in the
BackupAgent Server system. For full access to administrative functions an administrator
UsernameToken must be provided.
2.2 Code sample for connecting to a BackupAgent WebService
Deriving the proxy class from WSE 2.0 WebServiceClientProtocol in class definition:
public class BAWebService2 :
Microsoft.Web.Services2.WebServicesClientProtocol{ … }
Creating an object reference to attach a token:
StorageXS.BAWebService2 server = new StorageXS.BAWebService2();
UsernameToken token = new UsernameToken(username,password,PasswordOption.SendPlainText);