Profile Image Uploader
Overview
A simple application that allows the user to store and resize a primary and secondary image to their profile using the ASP.Net FileUpload.
Namespaces
This sample requires the following namespaces:
using ExigoWebService; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Net; using System.Text;
Exigo API Authentication
This sample accesses the Exigo Web Service using the ExigoApi object:
public ExigoApi Exigo { get { return new ExigoApi { ApiAuthenticationValue = new ApiAuthentication { LoginName = exigoAPILoginName, Password = exigoAPIPassword, Company = exigoAPICompany } }; } }
Fetching Images by Customer ID
This sample fetches the primary and secondary image data with the current customer ID.
return Exigo.GetCustomerSite(new GetCustomerSiteRequest { CustomerID = customerID });
Storing the Primary Image
This sample stores the primary image of the current customer to the Exigo API.
SetCustomerSiteImageRequest req = new SetCustomerSiteImageRequest(); req.CustomerID = customerID; //Unique identifier for a customer entity. req.ImageName = picName; req.ImageData = file; req.CustomerSiteImageType = CustomerSiteImageType.Primary; SetCustomerSiteImageResponse res = Exigo.SetCustomerSiteImage(req);
Storing the Secondary Image
This sample stores the secondary image of the current customer to the Exigo API.
SetCustomerSiteImageRequest req = new SetCustomerSiteImageRequest(); req.CustomerID = customerID; //Unique identifier for a customer entity. req.ImageName = picName; req.ImageData = file; req.CustomerSiteImageType = CustomerSiteImageType.Secondary; SetCustomerSiteImageResponse res = Exigo.SetCustomerSiteImage(req);