1

Since WPF 4 provides default configuration out of the box, I'm having difficulty trying to create a custom MTOM binding for my service. In short, my WCF library hosts several services that are using basic HTTP. One of the services is used for file uploads and requires MTOM. What can I do so that only my file upload service uses a custom defined MTOM binding and the rest use the default?

This is what I have so far:

<bindings>
  <basicHttpBinding>
    <binding
      name="FileTransferBinding"
      transferMode="Streamed"
      messageEncoding="Mtom"
      maxBufferSize="65536"
      maxReceivedMessageSize="10485760">
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service name="FileTransferService">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="FileTransferBinding" contract="MyServices.IFileTransfer"/>
  </service>
</services>

Thanks in advance!

dandax
  • 1,267
  • 3
  • 15
  • 22

1 Answers1

1

In order to configure a service, the service name in the <service> element needs to be the type fully qualified name of the class implementing the service, in order to identify the service that is being configured administratively.

<service name="MyNamcespace.FileTransferService">

Service element MSDN:

Name : Required String attribute that specifies the type of the service to be instantiated. This setting must equate to a valid type. The format should be Namespace.Class.

Pop Catalin
  • 61,751
  • 23
  • 87
  • 115
  • Thank Pop Catalin! That worked and I see Mtom on the client now but for some reason the client says transferMode="Buffered" and not "Streamed". Any thoughts on that one? – dandax Feb 07 '11 at 14:45
  • @dandax, streamed mode has strict requirements regarding the parameters for operations! http://msdn.microsoft.com/en-us/library/ms789010.aspx – Pop Catalin Feb 14 '11 at 12:55