The message with Action cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.

  • Thread starter Thread starter Maxspan
  • Start date Start date
M

Maxspan

Guest
I am trying to consume a third party WCF WSDL service and keep getting this error.

The message with Action cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.

Code:

public async Task<SearchBySerialNumberResponseMessage> ConsumeService()
{
string username = "MUS258";
string password = "TZXED739432W";
string development = "Discovery";
//string production = "Production";



SecurityBindingElement securityElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
securityElement.IncludeTimestamp = true;
TextMessageEncodingBindingElement encodingElement = new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8);
HttpsTransportBindingElement transportElement = new HttpsTransportBindingElement();


CustomBinding binding = new CustomBinding(securityElement, encodingElement, transportElement);

Task<SearchBySerialNumberResponseMessage> task = null;

EndpointAddress endpointAddress = new EndpointAddress(@"https://b2g-disc.ppsr.gov.au/PpsrB2GService/2016/05/CollateralRegistration.svc/soap11");
CollateralRegistrationSearchService2016Client client = new CollateralRegistrationSearchService2016Client(binding, endpointAddress);
client.ClientCredentials.UserName.UserName = username;
client.ClientCredentials.UserName.Password = password;
var ddd = client.ChannelFactory.CreateChannel();
task = ddd.SearchBySerialNumberAsync(new SearchBySerialNumberRequestMessage
{
TargetEnvironment = development,
SearchBySerialNumberRequest = new SearchBySerialNumberRequestType
{
SearchCriteria = new SearchBySerialNumberSearchCriteria
{
SerialNumber = "JS1SP46A000504266"
}
}
});

return await task;
}







Let us cook some code.

Continue reading...
 
Back
Top