One of my user encountered the following error when he is trying to use .NET to connect to the web services which are running under Apache CXF.
The web services have attachment and in order to consume them, the .NET web service client must be MTOM enabled, which is the part that caused the confusion.
The user claimed that he is using WSE 3.0 but obviously is not.
The Web Services Enhancements for Microsoft .NET (WSE) enables developers to create interoperable Web services with advanced Web services features. With WSE 3.0, you can secure your messages using digital signatures and encryption, use MTOM to efficiently send large amounts of binary data, route messages through intermediaries, host Web Services outside of IIS, use the TCP/IP protocol and more.
To take full advantage of WSE, I would advise you to install everything using the Custom installation option, which will integrate it with Visual Studio.
You may encounter the issue whereby WSE Settings Tool does not appear on the Visual Studio 2005 Solution Explorer content menu. This occurs if you install Visual Studio 2005 and then install WSE 3.0 without first having started Visual Studio 2005. Ensure that you start Visual Studio 2005 before installing WSE 3.0. Alternatively you can use the Visual Studio 2005 Add-in Manager available from the Tools menu item to manually install the WSE 3.0 Settings tool if you do install WSE 3.0 without having started Visual Studio 2005 first.
Alternatively you can also start the WSE Configuration Tool manually from the Start Menu, use it to open your web.config or App.config to configure the WSE settings.
To MTOM-enabled your application, right click on your project Properties, and click on WSE 3.0 Settings.
You must check on the Enable this project for Web Service Enhancements.
Also set the Client Mode to On for MTOM Settings
After this you can add a web reference to the web services WSDL. This will generate the proxy class for it. Make sure the proxy class for WSE inherits from Microsoft.Web.Services3.WebServicesClientProtocol instead of System.Web.Services.Protocols.SoapHttpClientProtocol. Sometimes the proxy class for WSE is not generated.