Created
July 17, 2012 21:49
-
-
Save jclement/3132356 to your computer and use it in GitHub Desktop.
Sample API Call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ServiceModel; | |
using ConsoleApplication6.TestApi; | |
namespace ConsoleApplication6 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
TestApi.TestApiContract testApiContract = new TestApi.TestApiContractClient( | |
new BasicHttpBinding(), | |
new EndpointAddress("http://localhost:8082/web/api/Test/TestApi") | |
); | |
var response = testApiContract.TestApi(new TestApiRequest() | |
{ | |
SampleRequiredString = "Sample 2", | |
SampleRequiredInteger = 1000, | |
SampleRequiredDecimal = 9.999m, | |
SampleRequiredNullableDecimal = null, | |
SampleRequiredDateTime = DateTime.Now, | |
SampleChildRecord = new TestApiChildRecord() | |
{ | |
SampleStringA = "A", | |
SampleStringB = "B", | |
SampleEnum = LanguageEnum.LangFrench | |
} | |
}); | |
Console.WriteLine(response.Summary); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment