Skip to content

WCF service integration does not work with Visual Studio 2017 15.5.4 #1209

Closed

Description

@rob2212

Description

When you create a new Xamarin Project in Visual Studio 2017 using .Net Standard libraries, the access to a WCF web service does no longer work. Even the example project by Xamarin does produce the same issue.

Steps to Reproduce

  1. Download the Xamarin example: https://developer.xamarin.com/guides/xamarin-forms/cloud-services/consuming/wcf/
  2. Build with Visual Studio 2017 15.5.4
  3. Run Android App on a real device

Expected Behavior

Method call to web service works (method: SoapService.RefreshDataAsync)

Actual Behavior

Exception: The message with Action '' 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).

Basic Information

  • IDE: Visual Studio 2017 15.5.4
  • Platform Target Frameworks:
    • iOS: Not tested
    • Android: Android SDK 7.1
    • UWP: Not tested
  • Android Support Library Version:
  • Affected Devices: Samsung Galaxy Tab A (2016)

Activity

  1. jonpryor commented on Jan 19, 2018

    @jonpryor
    Contributor

    @rob2212: Are there additional steps to reproduce? Do I need to setup a new backend?

    When I launch the app, it shows a dialog stating:

    Hosted Back-End

    This app is running against Xamarin read-only WCF service. To create, edit, and delete data you must update the service endpoint to point to your own hosted WCF service.

    If I dismiss the message, I'm able to tap the + button, enter TODO information, and tap SAVE, but adb logcat doesn't contain anything like your your Actual Behavior exception message.

    Would you be able to elaborate on step (3) "Run Android App on a real device"? Do you get the message just from launching the app? Or do you need to interact with it?

    Could you please provide the full error message and stack trace?

    A plausible explanation is that you're hosting your own WCF backend, and your WCF backend is configured to support only TLS 1.2+, while by default Xamarin.Android only supports TLS 1.0, as neither $(AndroidHttpClientHandlerType) nor $(AndroidTlsProvider) are set in the project.

  2. added
    need-infoIssues that need more information from the author.
    on Jan 19, 2018
  3. rob2212 commented on Jan 22, 2018

    @rob2212
    Author

    @jonpryor: It does not matter if it uses only the read-only public web service. You see the exception in the output window of Visual Studio when data is initially read:

    visualstudio

    Stack tracke:

    System.ServiceModel.ActionNotSupportedException: The message with Action '' 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).
      at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)
      at (wrapper delegate-end-invoke) <Module>:end_invoke_object__this___object[]&_IAsyncResult (object[]&,System.IAsyncResult)
      at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters, System.IAsyncResult result) [0x0001f] in <7e863646016b4a6f98d67323a81c736c>:0 
      at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object[] args, System.IAsyncResult result) [0x00045] in <7e863646016b4a6f98d67323a81c736c>:0 
      at TodoWCF.TodoWCFService.TodoServiceClient+TodoServiceClientChannel.EndGetTodoItems (System.IAsyncResult result) [0x00008] in e:\Entwicklung\TodoWCF\TodoWCF\Service References\TodoWCFService\Reference.cs:520 
      at TodoWCF.TodoWCFService.TodoServiceClient.TodoWCF.TodoWCFService.ITodoService.EndGetTodoItems (System.IAsyncResult result) [0x00001] in e:\Entwicklung\TodoWCF\TodoWCF\Service References\TodoWCFService\Reference.cs:239 
      at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in <657aa8fea4454dc898a9e5f379c58734>:0 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <657aa8fea4454dc898a9e5f379c58734>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0 
      at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0 
      at TodoWCF.SoapService+<RefreshDataAsync>d__8.MoveNext () [0x00069] in e:\Entwicklung\TodoWCF\TodoWCF\Data\SoapService.cs:49
    
  4. rob2212 commented on Feb 3, 2018

    @rob2212
    Author

    @jonpryor Could you reproduce the issue?

  5. jonpryor commented on Jun 5, 2018

    @jonpryor
    Contributor

    @rob2212: No, I was not able to reproduce. I was able to run the app, without throwing an exception, though it did tell me it was using the read-only service.

    Is this still a problem for you?

  6. jonathanpeppers commented on Sep 28, 2018

    @jonathanpeppers
    Member

    @rob2212 we haven't heard anything on this for a while. Visual Studio 15.8.4 is the latest version at present.

    Closing for now, feel free to reopen if you can send more info, thanks!

  7. ghost locked as resolved and limited conversation to collaborators on Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-infoIssues that need more information from the author.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions