This is my first attempt at a ServiceApplication and I am very new with the idea. I was using the WingtipCalc example code found here http://msdn.microsoft.com/en-us/library/gg543112.aspx I had no problem getting the calculator functions to work, but then I tried to modify so it would receive a filepath rather then two ints and output the content of that file in a string as opposed to the sum or subtraction of the two ints (the file is an xml doc). I added the necessary methods which were basically modified versions of the Add and Subtract methods and it seemed to be running fine until it got the ExecuteOnChannel delegate. I received this error:
The message with Action 'http://tempuri.org/IWingtipCalcContract/ViewXdoc' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
Here is the method that threw it:
private void ExecuteOnChannel(string operationName, CodeToRunOnChannel codeBlock)
{
SPServiceLoadBalancerContext loadBalancerContext = _loadBalancer.BeginOperation();
try
{
// get a channel to the service app endpoint
IChannel channel = (IChannel)GetChannel(loadBalancerContext.EndpointAddress);
try
{
// execute the code block
codeBlock((IWingtipCalcContract)channel);
channel.Close();
}
catch (TimeoutException)
{
loadBalancerContext.Status = SPServiceLoadBalancerStatus.Failed;
throw;
}
catch (EndpointNotFoundException)
{
loadBalancerContext.Status = SPServiceLoadBalancerStatus.Failed;
throw;
}
finally
{
if (channel.State != CommunicationState.Closed)
channel.Abort();
}
}
finally
{
loadBalancerContext.EndOperation();
}
}
Specifically this line:
codeBlock((IWingtipCalcContract)channel);
I wish I could provide more info, but like I said I am very new to this. Any help would be appreciated. Thanks!