0

I must consume a service with MTOM message but I get the error:

"Error creating a reader for the MTOM message" and the inner exception: "MIME part with Content-ID '<858d8f9f-b101-46c3-bf84-d2b934ad1271>' not found."

BasicHttpsBinding b = new BasicHttpsBinding(BasicHttpsSecurityMode.TransportWithMessageCredential)
            {
                MessageEncoding = WSMessageEncoding.Mtom
            };

MySoapClient client = new SomeSoapClient(b, new EndpointAddress(url));

client.ClientCredentials.UserName.UserName = username;
client.ClientCredentials.UserName.Password = password;

AxisValues ax = new AxisValues()
{
  Solution = "xxx",
  User = "xxxx"
};

// Exception is generated in this line
SomeResultType r = client.getSomeMethod(ax, new long[] { 1234 }, out SomeType[] list);
Syafiqur__
  • 531
  • 7
  • 15
Hugo
  • 13
  • 2

1 Answers1

0

Under the normal circumstance, there is no problem during the client call (at least on my side, it works properly).
The reason might cause this issue is that we modified the SOAP message, whose HTTP header Content-type is overwritten. Please refer to the below link.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/73039d75-e078-436b-a8ab-d8c7197a976b/error-creating-a-reader-for-the-mtom-message?forum=wcf
WCF: "Error creating reader for MTOM message"
Feel free to let me know if there is anything I can help with.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22