Bug 14741 - Unable to use WSMessageEncoding.Mtom - The requested feature is not implemented.
Summary: Unable to use WSMessageEncoding.Mtom - The requested feature is not implemented.
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.4.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-09-13 19:07 UTC by Neal
Modified: 2017-04-29 01:00 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Neal 2013-09-13 19:07:16 UTC
Hello,

I built a WCF service to upload binary files to my server. I am using a Mtom encoded service with streaming such as I do in a Winforms application with this same service implementation.  In a test case to use this service it appears as if the Mtom message encoding is returning a not implemented exception as I believe it is not seeing this as .NET 4.5 but is failing at the #if NET_2_1 check:

https://github.com/mono/mono/blob/master/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding_4_5.cs#L154

Here is my binding config:

        static BasicHttpBinding _binaryBinding;
        static BasicHttpBinding BinaryBinding
        {
            get
            {
                if (_binaryBinding == null)
                {
                    const int maxVal = 50000000;
                    _binaryBinding = new BasicHttpBinding() { Name="basicHttpBinding", MaxBufferSize = maxVal, MaxReceivedMessageSize=maxVal };
                    _binaryBinding.MessageEncoding = WSMessageEncoding.Mtom;
                    _binaryBinding.TransferMode = TransferMode.Streamed;
                    _binaryBinding.Security.Mode = BasicHttpSecurityMode.Transport;
                    _binaryBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
                    _binaryBinding.SendTimeout = new TimeSpan(0, 10, 0);
                    _binaryBinding.ReceiveTimeout = new TimeSpan(0, 10, 0);
                    System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => {
                        return true; };
                }
                return _binaryBinding;
            }
        }


Here is the exception:

System.NotImplementedException: The requested feature is not implemented.
  at System.ServiceModel.BasicHttpBinding.BuildMessageEncodingBindingElement () [0x0003a] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding_4_5.cs:154
  at System.ServiceModel.BasicHttpBinding.CreateBindingElements () [0x0001a] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding_4_5.cs:102
  at System.ServiceModel.Channels.CustomBinding..ctor (System.ServiceModel.Channels.Binding binding) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CustomBinding.cs:60
  at System.ServiceModel.Channels.Binding.CreateContext (System.ServiceModel.Channels.BindingParameterCollection parameters) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Binding.cs:96
  at System.ServiceModel.Channels.Binding.CanBuildChannelFactory[IDuplexChannel] (System.ServiceModel.Channels.BindingParameterCollection parameters) [0x00011] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Binding.cs:267
  at System.ServiceModel.ChannelFactory.CreateFactory () [0x000ad] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory.cs:201
  at System.ServiceModel.ChannelFactory.get_OpenedChannelFactory () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory.cs:57
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.ChannelFactory channelFactory, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:90
  at System.ServiceModel.ClientBase`1+ChannelBase`1[NCSoftware.Common.BinaryTransferService+IBinaryTransferService,NCSoftware.Common.BinaryTransferService+IBinaryTransferService].get_Inner () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:381
  at System.ServiceModel.ClientBase`1+ChannelBase`1[NCSoftware.Common.BinaryTransferService+IBinaryTransferService,NCSoftware.Common.BinaryTransferService+IBinaryTransferService].BeginInvoke (System.String methodName, System.Object[] args, System.AsyncCallback callback, System.Object state) [0x0003c] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:401
  at NCSoftware.Common.BinaryTransferService+BinaryTransferServiceClient+BinaryTransferServiceClientChannel.BeginUploadFile (NCSoftware.Common.RemoteFileInfo request, System.AsyncCallback callback, System.Object asyncState) [0x00015] in /Users/Neal/Dev/trunk/NCSoftware.Common/WCF/BinaryTransferService.cs:473
  at System.Threading.Tasks.TaskFactory`1[NCSoftware.Common.BinaryTransferService+UploadFileResponse].FromAsyncBeginEnd[RemoteFileInfo] (System.Func`4 beginMethod, System.Func`2 endMethod, NCSoftware.Common.RemoteFileInfo arg1, System.Object state, TaskCreationOptions creationOptions) [0x00061] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TaskFactory_T.cs:380
  at System.Threading.Tasks.TaskFactory`1[NCSoftware.Common.BinaryTransferService+UploadFileResponse].FromAsync[RemoteFileInfo] (System.Func`4 beginMethod, System.Func`2 endMethod, NCSoftware.Common.RemoteFileInfo arg1, System.Object state, TaskCreationOptions creationOptions) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TaskFactory_T.cs:362
  at System.Threading.Tasks.TaskFactory`1[NCSoftware.Common.BinaryTransferService+UploadFileResponse].FromAsync[RemoteFileInfo] (System.Func`4 beginMethod, System.Func`2 endMethod, NCSoftware.Common.RemoteFileInfo arg1, System.Object state) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TaskFactory_T.cs:356
  at NCSoftware.Common.BinaryTransferService+BinaryTransferServiceClient.UploadFileAsyncT (NCSoftware.Common.RemoteFileInfo request) [0x0002c] in /Users/Neal/Dev/trunk/NCSoftware.Common/WCF/BinaryTransferServiceTasks.cs:11
  at apdl.BinarySyncTest+<UploadBinaryAsync>c__asyncC.MoveNext () [0x00049] in /Users/Neal/Dev/trunk/apdlCustomContainerModel/apdl/UnitTestData/BinarySyncTest.cs:27
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00033] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
  at apdl.BarkerDataViewController+<SubmitProblemReport>c__async8.MoveNext () [0x00098] in /Users/Neal/Dev/trunk/apdlCustomContainerModel/apdl/DataViews/BarkerViewController.cs:78


Any help on how to get Mtom to work would be greatly appreciated.

Thank you.

Neal
Comment 1 nicolas.dougoud 2013-09-24 05:59:56 UTC
Exactly the same issue. Does Xamarin has a plan to support MTOM?
Comment 2 Neal 2013-12-19 10:45:49 UTC
Status please?
Comment 3 Alex Soto [MSFT] 2017-04-29 01:00:23 UTC
The Web services technologies that Xamarin supports can be found here[1/2]. There are no plans on supporting MTOM.

Another thing you could do is wrap your service with a REST service and have your Xamarin app consume the REST service.

Hope this helps.


[1]: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/

[2]: https://developer.xamarin.com/guides/xamarin-forms/cloud-services/consuming/