0

I have a WCF service, which expose multiple operation contracts. One contract is to upload a large file. So I want to use MTOM message encoding for that method and text encoding for other methods? How do I create a single service and use text and MTOM message encoding?

blue
  • 833
  • 2
  • 12
  • 39

1 Answers1

0

Each service contract has to be exposed on separate endpoint so for your upload file contract you can define endpoint with binding using MTOM encoding and for other contracts you can define endpoints with binding using text encoding.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • So I need to have two different services (.svc file) right? Currently I have it like that, is there any other way than not creating separate end points? – blue Sep 28 '10 at 18:00
  • 1
    No you don't need two services. You need two endpoints for single service. It is done in configuration: http://msdn.microsoft.com/en-us/library/ms751515%28v=vs.90%29.aspx – Ladislav Mrnka Sep 28 '10 at 18:09
  • On the client each exposed contract/endpoint is handled as "separate" service. So if you want to call methods from two contracts you need to create two proxies. – Ladislav Mrnka Sep 28 '10 at 18:23
  • While creating the proxy I can specify the endpoint name like, Dim wsBinding As New WSFederationHttpBinding("endpoint name") right? – blue Sep 28 '10 at 18:28