Skip to content

Instantly share code, notes, and snippets.

@chaliy
Created January 15, 2010 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaliy/278511 to your computer and use it in GitHub Desktop.
Save chaliy/278511 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace ProcessingService
{
[DataContract(Namespace = "urn:just-applications:nventree:batch-v1.0")]
public class Argument
{
[DataMember(IsRequired = true, Order = 0)]
public string Key { get; set; }
[DataMember(IsRequired = true, Order = 1)]
public string Value { get; set; }
}
[DataContract(Namespace = "urn:just-applications:nventree:batch-v1.0")]
public class BatchItem
{
[DataMember(IsRequired = true, Order = 0)]
public List<Argument> Arguments { get; set; }
}
[DataContract(Namespace = "urn:just-applications:nventree:batch-v1.0")]
public class Batch
{
[DataMember(IsRequired = true, Order = 0)]
public string Id { get; set; }
[DataMember(IsRequired = true, Order = 1)]
public string ProcessorKey { get; set; }
[DataMember(IsRequired = true, Order = 2)]
public List<BatchItem> Items { get; set; }
}
[ServiceContract(Name = "BatchQueueContract",
ConfigurationName = "BatchQueue",
Namespace = "urn:just-applications:nventree:batch-v1.0",
SessionMode = SessionMode.Required)]
public class BatchQueue
{
[OperationContract(IsOneWay = true)]
public void Queue(Batch batch)
{
Console.WriteLine("Queued!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment