Skip to content

Instantly share code, notes, and snippets.

View skenderbeu's full-sized avatar

Peter Campbell skenderbeu

View GitHub Profile
@skenderbeu
skenderbeu / gist:1490111
Created December 17, 2011 12:35
Example OData feed from WestCumbriaChurch
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom">
<title type="text">Churches</title>
<id><strong>http://localhost:49933/WestCumbriaChurch.svc/Churches/</strong> </id>
<updated>2011-09-03T10:21:33Z</updated>
<link rel="self" title="Churches" href="Churches" />
<entry>
<id><strong> http://localhost:49933/WestCumbriaChurch.svc/Churches(3) </strong> </id>
<title type="text"></title>
@skenderbeu
skenderbeu / jsonp_OData.js
Created December 21, 2011 21:20
Example jquery JSONP OData request
$.ajax({
url: "http://WestCumbriaChurch.org.uk/WestCumbriaChurch.svc/Churches/?$format=json",
contentType: 'application/json; charset=utf-8',
type: 'GET',
dataType: 'jsonp',
error: function (xhr, status) {
alert(status);
},
success: function (result) {
//TODO: Display the result
using System;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Channels;
using System.ServiceModel;
using System.IO;
namespace RoyalMail
{
/// <summary>
/// Used - https://blogs.msdn.microsoft.com/mohamedg/2012/12/13/adding-http-headers-to-wcf-calls/
using System;
using System.IO;
using System.ServiceModel.Channels;
using System.Text;
using System.Xml;
namespace RoyalMail
{
public class LogMessage
{
using System;
using System.IO;
using System.ServiceModel.Channels;
namespace RoyalMail
{
public class RequestMessage: LogMessage
{
public RequestMessage(Guid guid)
{
using System;
using System.IO;
using System.ServiceModel.Channels;
namespace RoyalMail
{
public class ResponseMessage: LogMessage
{
private Guid guid;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Channels;
namespace RoyalMail
{
public class RoyalMailMessageFormatter : IClientMessageFormatter
{
private readonly IClientMessageFormatter formatter;
public RoyalMailMessageFormatter(IClientMessageFormatter formatter)
using System.ServiceModel.Channels;
using System.Xml;
namespace RoyalMail
{
public class RoyalMailMessage : Message
{
private readonly Message message;
public RoyalMailMessage(Message message)
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Channels;
namespace RoyalMail
{
public class RoyalMailOperationBehavior : IOperationBehavior
{
public RoyalMailOperationBehavior() { }
using System.ServiceModel.Description;
namespace RoyalMail
{
public class EndPointBehaviour: IEndpointBehavior
{
RoyalMailHeaderCredentials _credentials;
public void ApplyClientBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
{