Created
March 19, 2012 19:20
-
-
Save manadart/2124994 to your computer and use it in GitHub Desktop.
Example usage of service call to SS FMC using a service client.
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
// This code requires the following assemblies to be referenced: | |
// ServiceStack.Common | |
// ServiceStack.Interfaces | |
// ServiceStack.ServiceInterface | |
// GeomaticTechnologies.Eis.Yvw.ServiceModel | |
using System.Collections.Generic; | |
using System.Net; | |
using GeomaticTechnologies.Eis.Yvw.ServiceModel; | |
using ServiceStack.Service; | |
using ServiceStack.ServiceInterface.Auth; | |
using ServiceStack.ServiceClient.Web; | |
public class FmcServiceClient | |
{ | |
public void CallTheMeterStockService() | |
{ | |
using (IServiceClient client = new Soap12ServiceClient("supplied_uri")) | |
{ | |
client.Send<AuthResponse>(new Auth | |
{ | |
provider = CredentialsAuthProvider.Name, | |
UserName = "supplied_user_name", | |
Password = "supplied_password" | |
}); | |
var request = new SendMeterDetails { MeterDetails = new List<MeterDetail> { new MeterDetail { MeterNumber = "123", Size = "456" } } }; | |
var response = client.Send<SendMeterDetailsResponse>(request); | |
// Do your interrogation of the response. | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment