Hi,
I am trying to consume a java wenb service which has MTOM feature enabled.
I developed a Asp.Net aplication as client which consumes the above java webservice.
How can we enable MTOM feature on the asp.net Client ?

Dani AI

Generated

Short answer: the missing RequireMtom usually means the generated client proxy is not a WSE 3.0 (WSE-enabled) ASMX proxy. Two practical options: (A) generate a WSE proxy so the RequireMtom property exists, or (B) use WCF and enable MTOM in the binding (recommended for new work). This expands on ’s WSE suggestion and explains why can't see RequireMtom.

How to get RequireMtom (WSE route)

  • Install WSE 3.0 and add a reference to Microsoft.Web.Services3.dll, then enable WSE for the project (WSE Settings 3.0). After WSE is enabled, remove and re-add the Web Reference (use “Add Web Reference”, not “Add Service Reference”) so Visual Studio generates a *Wse proxy that inherits from Microsoft.Web.Services3.WebServicesClientProtocol. See Microsoft’s WSE guidance. (learn.microsoft.com)
  • If you cannot re-generate, edit the generated proxy class: change the base from SoapHttpClientProtocol to Microsoft.Web.Services3.WebServicesClientProtocol and add the WSE assembly reference; the proxy will then expose RequireMtom (you can set it true before calling). Practical examples and a community solution that uses this edit are shown on StackOverflow. (stackoverflow.com)

WCF alternative (recommended for maintainability)

  • Use a WCF client and set the binding to use MTOM. Example config snippet:

    <basicHttpBinding>
      <binding name="Basic" messageEncoding="Mtom" />
    </basicHttpBinding>

    WCF also supports a <mtomMessageEncoding> element for custom bindings. This is the modern, fully supported approach. (learn.microsoft.com)

How to tell whether the Java service supports MTOM

  • Inspect the WSDL for XOP/xmime annotations or WS‑Policy assertions (look for http://www.w3.org/2004/08/xop/include or http://www.w3.org/2005/05/xmlmime namespaces). Some JAX‑WS services advertise MTOM via policy; others don’t — in those cases a real request and inspecting the response Content‑Type (application/xop+xml / multipart/related) is the most reliable test. (docs.oracle.com)

Troubleshooting tips

  • If you see “expected text/xml” errors, check SOAP versions (1.1 vs 1.2) and make sure client binding/messageVersion matches the server. Use a traffic inspector (Fiddler/Wireshark) to verify the response Content‑Type and MIME parts. If moving forward, prefer WCF/MTOM for cleaner configuration and better tooling. (learn.microsoft.com)

Recommended Answers

All 6 Replies

Thank you.
I am not getting the property RequireMTOM for the java web service proxy.
How can we know whether the java web service has Mtom Feature enabled.

>I am trying to consume a java wenb service which has MTOM feature enabled.

:D

how to check wheter the java web service has MTOM feature enabled.
I am having only WSDL of the java web service.

>how to check wheter the java web service has MTOM feature enabled.

Send binary attachments such as images or files along with Web services requests.

I am not able to view the property RequireMTOM when created proxy for the Javawebservice.
Even i configured using WSE 3.0.
Could any one help me in how can i get the property Require.MTOM visible for the proxy created.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.