Lead Validation C# Code Snippet

try
{
    //Will Us the endpoing with the "Primary" name in the web.config
    wsClient = new LVSoapServiceClient("Primary");
    response = wsClient.ValidateLead_V3(FullName.Text, Salutation.Text, FirstName.Text, LastName.Text, BusinessName.Text, BusinessDomain.Text, BusinessEIN.Text, Address1.Text, Address2.Text, Address3.Text, Address4.Text, Address5.Text, Locality.Text, AdminArea.Text, PostalCode.Text, Country.Text, Phone1.Text, Phone2.Text, Email.Text, IPAddress.Text, Gender.Text, DateOfBirth.Text, UTCCaptureTime.Text, OutputLanguage.Text, TestType.Text, LicenseKey.Text);
    if (response == null || (response.Error != null && response.Error.TypeCode == "3"))
    {
        throw new Exception();
    }
}
catch
{
    wsClient = new LVSoapServiceClient("Backup");
    response = wsClient.ValidateLead_V3(FullName.Text, Salutation.Text, FirstName.Text, LastName.Text, BusinessName.Text, BusinessDomain.Text, BusinessEIN.Text, Address1.Text, Address2.Text, Address3.Text, Address4.Text, Address5.Text, Locality.Text, AdminArea.Text, PostalCode.Text, Country.Text, Phone1.Text, Phone2.Text, Email.Text, IPAddress.Text, Gender.Text, DateOfBirth.Text, UTCCaptureTime.Text, OutputLanguage.Text, TestType.Text, LicenseKey.Text);
}

Lead Validation Java Code Snippet

ContactInternational wsResponse = null;
LVSoapServiceLocator locator = new LVSoapServiceLocator();
locator.setDOTSLeadValidationInternationalEndpointAddress("https://trial.serviceobjects.com/LV/soap.svc/SOAP");
ILVSoapService lv = locator.getDOTSLeadValidationInternational();
DOTSLeadValidationInternationalStub soap = (DOTSLeadValidationInternationalStub)lv;
soap.setTimeout(20000);
try
{
    wsResponse = soap.validateLead_V3(FullName,Salutation,FirstName,LastName,BusinessName,BusinessDomain,BusinessEIN,Address1,Address2,Address3,Address4,Address5,Locality,AdminArea,PostalCode,Country,Phone1,Phone2,Email,IPAddress,Gender,DateOfBirth,UTCCaptureTime,OutputLanguage,TestType,LicenseKey);
    if (wsResponse == null ||(wsResponse.getError() != null && wsResponse.getError().getTypeCode().equals("3")))
    {
        throw new Exception();
    }
}
catch (Exception ex)
{
    //Use backup URL here i.e. swsbackup.serviceobjects.com when a production key is purchased
    locator.setDOTSLeadValidationInternationalEndpointAddress("https://trial.serviceobjects.com/LV/soap.svc/SOAP");
    ILVSoapService lvBackup = locator.getDOTSLeadValidationInternational();
    DOTSLeadValidationInternationalStub soapBackup = (DOTSLeadValidationInternationalStub)lv;
    soap.setTimeout(20000);
      
    wsResponse = soapBackup.validateLead_V3(FullName,Salutation,FirstName,LastName,BusinessName,BusinessDomain,BusinessEIN,Address1,Address2,Address3,Address4,Address5,Locality,AdminArea,PostalCode,Country,Phone1,Phone2,Email,IPAddress,Gender,DateOfBirth,UTCCaptureTime,OutputLanguage,TestType,LicenseKey);
}