Java HTTP Post against .NET WCF - "ContractFilter mismatch at the EndpointDispatcher"
I have a WCF service that one of our clients is trying to connect too using Java. They are doing a HTTP Post using the following XML.
I'm getting an error outlined below
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:/开发者_StackOverflow社区/www.w3.org/2001/XMLSchema-instance">
<env:Header></env:Header>
<env:Body>
<req:GetLeads xmlns:req="http://tempuri.org">
<userName>blah</userName>
<password>blow</password>
<startDateTime>2010-09-24T12.01.37</startDateTime>
<endDateTime>2011-03-25T09.07.41</endDateTime>
</req:GetLeads>
</env:Body>
</env:Envelope>
Error Message
The message with Action 'https://carinsuranceapp.uat.infochoice.com.au/LeadReports.svc/basic' 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).
Stack Trace
at System.ServiceModel.Dispatcher.ErrorBehavior.ThrowAndCatch(Exception e, Message message)
at System.ServiceModel.Dispatcher.ChannelHandler.ReplyFailure(RequestContext request, Message fault, String action, String reason, FaultCode code)
at System.ServiceModel.Dispatcher.ChannelHandler.ReplyContractFilterDidNotMatch(RequestContext request)
at System.ServiceModel.Dispatcher.ChannelHandler.EnsureChannelAndEndpoint(RequestContext request)
at System.ServiceModel.Dispatcher.ChannelHandler.TryRetrievingInstanceContext(RequestContext request)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
It would be easier to pinpoint the issue, if you shared your WSDL.
There are a couple of things you could do to figure out what is happening.
- Use WCFTestClient.exe to connecting to your service and call the method. It allows you to look at the XML payload being sent to the server. You could compare it with what your client is sending.
- Configure tracing in your service - http://msdn.microsoft.com/en-us/library/ms733025.aspx. It is easier to do this using WCFConfigEditor.exe. You will see more details of what is causing the failure when you look at the trace file.
BTW it appears your client is sending SOAP 1.1. If it is acceptable in your scenario you might try changing the binding on your service to basicHttpBinding instead of wsHttpBinding.
精彩评论