You can use Microsoft Visual Studio to implement a client application that uses the Luminate Online Web Services. This topic outlines the process for Visual C#.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Convio.SoapClient client = new Convio.SoapClient(); System.Console.WriteLine("Connecting to " + client.Endpoint.Address); Convio.LoginResult result = client.Login("myapiuser", "myapipassword"); System.Console.WriteLine("Login successful"); } } }The finished program should look like this:
Site-specific applications can simply use the static endpoint URL specified by the WSDL. Generic applications that can access multiple sites have to specify the endpoint URL at runtime. This can be done simply by overriding the Endpoint.Address property:
using System.ServiceModel; ... Convio.SoapClient client = new Convio.SoapClient(); client.Endpoint.Address = new EndpointAddress("http://webservices.cluster2.convio.net/1.0/mysite");
The Luminate Online WSDL defines all fields as both nullable and optional (minOccurs="0"). This makes it easier to send and receive partial records, including only relevant fields, rather than requiring both the client and server to specify full records for every operation.
To distinguish between null elements that should be specified as nil and elements that should simply be omitted, the standard XML serializer generated by the .NET framework adds a special flag to each non-String attribute. This flag must be set to true for the attribute to be serialized as part of a SOAP message:
Convio.Constituent constituent = new Convio.Constituent(); constituent.ExternalYtdGiftAmountSpecified = true; // this flag must be set to serialize this attribute in the SOAP message. constituent.ExternalYtdGiftAmount = 500.00;
Comments