Skip to content

Instantly share code, notes, and snippets.

@manadart
Created March 19, 2012 19:20
Show Gist options
  • Save manadart/2124994 to your computer and use it in GitHub Desktop.
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 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