Difference between pages "Pnsamplecsharp" and "PavcSharp"

From CDYNE Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Mbaughman
(NotifyPhoneBasic)
 
imported>Alauerman
 
Line 1: Line 1:
Samples of Phone Notify! in C#
+
'''Using as a Service Reference'''<br>
=='''getVoices'''==
+
Add a service reference to your project that will point to http://pav3.cdyne.com/PavService.svc?wsdl
<code type=csharp>
 
  
pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
+
==Sample Code==
Voice[] voices = pn.getVoices();
 
  
//  Lists available voices in a console
+
====Verify Address====
foreach (Voice item in voices)
 
{
 
    Console.WriteLine(item.VoiceSummary.ToString());
 
}
 
Console.ReadKey(true);
 
  
</code>
+
<code>
 
+
pav.PavServiceClient PSC = new pav.PavServiceClient("pavsoap");
=='''UploadSoundFile'''==
+
pav.Address PavAdd = new pav.Address();
<code type=csharp>
 
</code>
 
 
 
=='''RecordSoundViaPhoneCall'''==
 
<code type = csharp>
 
</code>
 
 
 
=='''NotifyPhoneEnglishBasic'''==
 
<code type=csharp>
 
 
 
pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
pnweb.NotifyReturn nr = pn.NotifyPhoneEnglishBasic("15555555555",
 
"Hello, this is a test.","00000000-0000-0000-0000-000000000000");
 
 
 
</code>
 
 
 
=='''NotifyPhoneBasic'''==
 
<code type=csharp>
 
 
 
pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
pnweb.NotifyReturn nr = pn.NotifyPhoneBasic("15555555555",
 
"Hello, this is a test.", "1555555555", "Test Caller ID", "0", "0000000-0000-0000-0000-000000000000");
 
  
 +
PavAdd = PSC.VerifyAddress("CDYNE Corporation", "2125 Smith Ave", " ", " ", "Chesapeake", "VA", "23320", "LICENSE KEY");
 +
        Console.WriteLine(
 +
                PavAdd.FirmNameOrRecipient.ToString() + " " +
 +
                PavAdd.PrimaryAddressLine.ToString() + " " +
 +
                PavAdd.SecondaryAddressLine.ToString() + " " +
 +
                PavAdd.CityName.ToString() + " " +
 +
                PavAdd.StateAbbreviation.ToString() + " " +
 +
                PavAdd.ZipCode.ToString() + " " +
 +
                PavAdd.County.ToString() + " " +
 +
                PavAdd.Urbanization.ToString() + " " +
 +
                PavAdd.Country.ToString()
 +
                );
 
</code>
 
</code>
  
=='''NotifyPhoneBasicWithTransfer'''==
+
====Verify Address Advanced====
<code type=csharp>
 
namespace phnotify
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
            pnweb.NotifyReturn nr = pn.NotifyPhoneBasicWithTransfer("15555555555","15555555555",
 
            "Hello, this is a test. Press 0 to be transfered to the TransferNumber",
 
            "15555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
 
        }
 
    }
 
}
 
</code>
 
  
=='''NotifyPhoneBasicWithTryCount'''==
+
====Get Intelligent Mail Barcode====
<code type=csharp>
 
namespace phnotify
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
            pnweb.NotifyReturn nr = pn.NotifyPhoneBasicWithTryCount(3,"15555555555",
 
            "Hello, this is a test.", "1555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
 
        }
 
    }
 
}
 
</code>
 
  
=='''NotifyMultiplePhoneBasic'''==
+
====Get Zip Codes For City and State====
<code type=csharp>
 
namespace phnotify
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
            pnweb.NotifyReturn[] nr = pn.NotifyMultiplePhoneBasic("15555555555; 15555555555",
 
            "Hello, This is a test.", "15555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
 
  
        }
+
====Get City Names For A Zip Code====
    }
 
}
 
</code>
 
  
=='''NotifyPhoneAdvanced'''==
+
====Get Urbanization List For Zip Code====
<code type=csharp>
 
namespace phnotify
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
            pnweb.AdvancedNotifyRequest anr = new pnweb.AdvancedNotifyRequest();
 
            anr.CallerIDName = "Test Caller ID";
 
            anr.CallerIDNumber = "15555555555";
 
            anr.PhoneNumberToDial = "15555555555";
 
            anr.TextToSay = "Hello, this is a test.";
 
            anr.LicenseKey = "00000000-0000-0000-0000-000000000000";
 
            anr.VoiceID = 0;
 
            anr.TryCount = 1;
 
            anr.NextTryInSeconds = 3600;
 
            anr.UTCScheduledDateTime = DateTime.UtcNow;
 
            pnweb.NotifyReturn response = pn.NotifyPhoneAdvanced(anr);
 
        }
 
    }
 
}
 
 
 
</code>
 
 
 
=='''NotifyMultiplePhoneAdvanced'''==
 
<code type = csharp>
 
namespace phnotify
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
 
            pnweb.AdvancedNotifyRequest anr = new pnweb.AdvancedNotifyRequest();
 
            anr.CallerIDName = "Test Caller ID";
 
            anr.CallerIDNumber = "15555555555";
 
            anr.PhoneNumberToDial = "15555555555; 15555555555; 15555555555";
 
            anr.TextToSay = "Hello, this is a test.";
 
            anr.LicenseKey = "00000000-0000-0000-0000-000000000000";
 
            anr.VoiceID = 0;
 
            anr.TryCount = 1;
 
            anr.NextTryInSeconds = 3600;
 
            anr.UTCScheduledDateTime = DateTime.UtcNow;
 
            pnweb.NotifyReturn response = pn.NotifyPhoneAdvanced(anr);
 
        }
 
    }
 
}
 
</code>
 
<!--
 
=='''GetResponseCodes'''==
 
=='''GetQueueIDStatus'''==
 
=='''GetMultipleQueueIDStatus'''==
 
=='''GetQueueIDStatusWithAdvancedInfo'''==
 
=='''CancelNotify'''==
 
=='''GetSoundFile'''==
 
=='''GetSoundFileInMP3'''==
 
=='''GetSoundFileURL'''==
 
=='''GetSoundFileInUlaw'''==
 
=='''GetTTSInMP3'''==
 
=='''GetTTSInUlaw'''==
 
=='''RemoveSoundFile'''==
 
=='''ReturnSoundFileIDs'''==
 
=='''LM_AddNewList'''==
 
=='''LM_AddListMember'''==
 
=='''LM_DeleteList'''==
 
=='''GetIncomingCallScript'''==
 
=='''SetIncomingCallScript'''==
 
=='''LicenseKeyVariableSave'''==
 
=='''LicenseKeyVariableLoad'''==
 
=='''ScriptSave'''==
 
=='''ScriptList'''==
 
=='''ScriptLoad'''==
 
=='''ScriptDelete'''==
 
=='''GetVersion'''==
 
-->
 

Revision as of 15:22, 25 October 2011

Using as a Service Reference
Add a service reference to your project that will point to http://pav3.cdyne.com/PavService.svc?wsdl

Sample Code

Verify Address

pav.PavServiceClient PSC = new pav.PavServiceClient("pavsoap");
pav.Address PavAdd = new pav.Address();
PavAdd = PSC.VerifyAddress("CDYNE Corporation", "2125 Smith Ave", " ", " ", "Chesapeake", "VA", "23320", "LICENSE KEY");
        Console.WriteLine(
               PavAdd.FirmNameOrRecipient.ToString() + " " +
               PavAdd.PrimaryAddressLine.ToString() + " " +
               PavAdd.SecondaryAddressLine.ToString() + " " +
               PavAdd.CityName.ToString() + " " +
               PavAdd.StateAbbreviation.ToString() + " " +
               PavAdd.ZipCode.ToString() + " " +
               PavAdd.County.ToString() + " " +
               PavAdd.Urbanization.ToString() + " " +
               PavAdd.Country.ToString()
               );

Verify Address Advanced

Get Intelligent Mail Barcode

Get Zip Codes For City and State

Get City Names For A Zip Code

Get Urbanization List For Zip Code