• 0

[C#/WCF] MTOM causes the service call to fail


Question

Ive been toying around with MTOM on other example projects that have worked just fine. I have another example project that calls the service just fine. As soon as I add mtom as the message encoding to both the service and the client I get Content Type multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:cb781f20-b41b-429a-8e2d-de6accd8fbb5+id=1";start-info="text/xml" was not supported by service http://www.mysite.co...cf/TestSvc.svc. The client and service bindings may be mismatched.

Service config:


&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;

  &lt;system.web&gt;
	&lt;compilation debug="true" /&gt;
  &lt;/system.web&gt;
  &lt;!-- When deploying the service library project, the content of the config file must be added to the host's
  app.config file. System.Configuration does not support config files for libraries. --&gt;
  &lt;system.serviceModel&gt;
	&lt;services&gt;
	  &lt;service name="TestSvc.TestSvc"&gt;
		&lt;endpoint address="" bindingConfiguration="ITestSvc" binding="basicHttpBinding" contract="TestSvc.ITestSvc"&gt;
		  &lt;identity&gt;
			&lt;dns value="localhost" /&gt;
		  &lt;/identity&gt;
		&lt;/endpoint&gt;
		&lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
		&lt;host&gt;
		  &lt;baseAddresses&gt;
			&lt;add baseAddress="http://localhost:8732/Design_Time_Addresses/TestSvc/Service1/" /&gt;
		  &lt;/baseAddresses&gt;
		&lt;/host&gt;
	  &lt;/service&gt;
	&lt;/services&gt;
	&lt;bindings&gt;
	  &lt;basicHttpBinding&gt;
		&lt;binding transferMode="Streamed" name="ITestSvc" maxReceivedMessageSize="2000000000" maxBufferPoolSize="2000000000" maxBufferSize="2000000000" messageEncoding="Mtom" openTimeout="10:00:00" sendTimeout="10:00:00" receiveTimeout="10:00:00"&gt;
		  &lt;readerQuotas maxArrayLength="2000000000" maxBytesPerRead="2000000000" maxStringContentLength="2000000000"/&gt;
		&lt;/binding&gt;
	  &lt;/basicHttpBinding&gt;
	&lt;/bindings&gt;
	&lt;behaviors&gt;
	  &lt;serviceBehaviors&gt;
		&lt;behavior&gt;
		  &lt;!-- To avoid disclosing metadata information,
		  set the value below to false and remove the metadata endpoint above before deployment --&gt;
		  &lt;serviceMetadata httpGetEnabled="True"/&gt;
		  &lt;!-- To receive exception details in faults for debugging purposes,
		  set the value below to true.  Set to false before deployment
		  to avoid disclosing exception information --&gt;
		  &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt;
		&lt;/behavior&gt;
	  &lt;/serviceBehaviors&gt;
	&lt;/behaviors&gt;
	&lt;serviceHostingEnvironment&gt;
	  &lt;baseAddressPrefixFilters&gt;
		&lt;add prefix="http://www.mysite.com/testwcf/"/&gt;
	  &lt;/baseAddressPrefixFilters&gt;
	&lt;/serviceHostingEnvironment&gt;
  &lt;/system.serviceModel&gt;

&lt;/configuration&gt;


client config


&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
	&lt;system.serviceModel&gt;
		&lt;bindings&gt;
			&lt;basicHttpBinding&gt;
			  &lt;binding name="BasicHttpBinding_ITestSvc" transferMode="Streamed" maxReceivedMessageSize="2000000000" maxBufferPoolSize="2000000000" maxBufferSize="2000000000" messageEncoding="Mtom" openTimeout="10:00:00" sendTimeout="10:00:00" receiveTimeout="10:00:00"&gt;
				&lt;readerQuotas maxArrayLength="2000000000" maxBytesPerRead="2000000000" maxStringContentLength="2000000000"/&gt;
			  &lt;/binding&gt;
			&lt;/basicHttpBinding&gt;
		&lt;/bindings&gt;
		&lt;client&gt;
			&lt;endpoint address="http://www.mysite.com/testwcf/TestSvc.svc"
				binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestSvc"
				contract="TestSvc.ITestSvc" name="BasicHttpBinding_ITestSvc" /&gt;
		&lt;/client&gt;
	&lt;/system.serviceModel&gt;
&lt;/configuration&gt;

I mean...the service operations just fine until I add the message encoding to mtom on both sides. I haven't had this issue with adding mtom encoding before...is there something else I'm missing?

3 answers to this question

Recommended Posts

  • 0

well I can't seem to edit my post so I have to post again (sorry). I did notice that when I change the client side binding back to text it works when I make a call. So the server is not accepting the changes but the client is. Would there be any reason for this? The first project has similar configurations and it works with mtom just fine. This one (and every other project I've made since) refuses to accept the mtom change :(

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Microsoft kills AI-powered history search feature in Edge by Usama Jawad In June 2025, Microsoft began rolling out AI-powered history search functionality with Edge 138. The idea was simple: allow customers to use natural language phrases and synonyms to find their desired history items rather than matching keywords exactly. Although the company had already rolled out this capability in a phased manner, it has now decided to cancel it. In an update on its Microsoft 365 Roadmap, Microsoft has announced that it has decided not to move forward with AI-powered history search. The company has not detailed the exact reasoning behind this move, but it has apologized to customers for the inconvenience. The move is rather interesting as it seemingly could have improved user productivity. Edge users wouldn't have to worry about typos or exact keywords, and just focus on what they were trying to locate in their browser history. Microsoft had also assured users that an on-device AI model would be leveraged for this functionality, and no data would be sent to the cloud. IT admins also had the ability to control its availability through the EdgeHistoryAISearchEnabled policy. When the feature began rolling out last year, many of our readers called it creepy, noting that they couldn't trust Microsoft to keep their data on their device. Others also questioned its usefulness, saying that it's simply a way for Microsoft to insert more AI bloat into its products. Although the Redmond tech giant had stated that it will be more mindful about surfacing Copilot features in Windows 11 apps, we later discussed how this is mostly a rebranding exercise rather than an actual axing of AI functionalities. Indeed, a Microsoft executive later emphasized how they want to reshape Windows for the agentic AI era. That said, it does seem like at least AI-powered Edge history search isn't a part of that vision.
    • For you to jump on and defend your sweetheart? I agree, it didn't.
    • Not likely, of course, that we will see routine citizenship checks as they only involve compliance with existing federal voting laws already on the books for decades. This seems a non-issue entirely. Only fools would have the government rush headlong into an AI program few can understand or predict, or even debug...
  • Recent Achievements

    • Week One Done
      tuben earned a badge
      Week One Done
    • First Post
      OffsetAbs earned a badge
      First Post
    • Reacting Well
      OffsetAbs earned a badge
      Reacting Well
    • First Post
      Kolakid60 earned a badge
      First Post
    • Week One Done
      xvvxcvv earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      424
    2. 2
      +Edouard
      185
    3. 3
      PsYcHoKiLLa
      147
    4. 4
      Steven P.
      72
    5. 5
      FloatingFatMan
      71
  • Tell a friend

    Love Neowin? Tell a friend!