• 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

    • Autonomous post-training loop placed 8th of 4,000 and then rewrote its own evaluation strategy. An autonomous AI system built by researchers at Amazon's A-EVO-Lab completed a full post-training run on a 30 billion parameter NVIDIA Nemotron model — with no human in the loop, across four rounds running over multiple weeks — and then did something its designers had not planned for: it detected that its own internal evaluation metric had become misleading and redesigned the search strategy it was using to improve itself. https://www.techtimes.com/articles/319123/20260626/nvidia-ai-trained-itself-30b-model-corrected-its-own-broken-metric-mid-run.htm
    • Grok Adult Content Tops 10 Billion Images Monthly More than half of all traffic flowing through Grok, Elon Musk's flagship AI product, now comes from users requesting pornographic images, explicit videos, and **** roleplay https://www.techtimes.com/articles/319142/20260626/grok-adult-content-tops-10-billion-images-monthly-xai-engineers-admit-csam-has-no-fix.htm
    • If Ford would stop hiring SUITS to run the company, and put CAR GUYS back in charge perhaps they could do better. Heck, the only CAR they produce today is the Mustang. Hey Ford! Not everyone needs/wants an overpriced SUV or pickup truck that is so tall you have to have a step ladder to get in and out of it.
    • Amazing how some will just jump all over something. Probably the same people that thought Musk was a "tech god" before he saddled up with "bad orange man". Before, they worshiped at his feet, including a lot of so called hollywood types. Now, because he fell off the plantation truck, they toss him under the bus.
  • Recent Achievements

    • One Year In
      bernmeister earned a badge
      One Year In
    • Week One Done
      Scoobystu earned a badge
      Week One Done
    • 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
  • Popular Contributors

    1. 1
      +primortal
      494
    2. 2
      +Edouard
      228
    3. 3
      PsYcHoKiLLa
      162
    4. 4
      Steven P.
      76
    5. 5
      FloatingFatMan
      71
  • Tell a friend

    Love Neowin? Tell a friend!