I have a service which exposes one of the operations with MTOM enabled 
response. Looking at the .NET Service WSDL 

I see the following:

 

<s:element name="exportResponse">

 <s:complexType>

  <s:sequence>

   <s:element minOccurs="0" maxOccurs="1" name="exportResult" 
type="tns:AContent" /> 

  </s:sequence>

 </s:complexType>

</s:element>

<s:complexType name="AContent">

 <s:sequence>

  <s:element minOccurs="0" maxOccurs="1" name="aData" type="s:base64Binary" /> 

 </s:sequence>

</s:complexType>

 

How does Axis client make the determination that this is MTOM encoded data from 
server end?

 

I tried setting ENABLE_MTOM property in my client stub constructor code 
(generated using adb) as follows:

 

       org.apache.axis2.client.Options opts = _serviceClient.getOptions();

       opts.setProperty(Constants.Configuration.ENABLE_MTOM, 
Constants.VALUE_TRUE);

       _serviceClient.setOptions(opts);

 

but that does not solve the problem. Any suggestions on what I can try?

I get the following SOAP Fault, that the server was unreachable.

 

            <soap:Fault>

               <faultcode>soap:Server</faultcode>

               <faultstring>Server unavailable, please try later</faultstring>

               <faultactor>http://hola5/MyService/Service.asmx</faultactor>

            </soap:Fault>

 

 

If I remove Constants.Configuration.ENABLE_MTOM property, and try to run the 
client, I see base encoded string in TCPMON, something like:

 

           <exportResult>

               <aData>PD94bWwgdmVyc2lvbj0iMS4wIiBlbm......... </aData>

            </exportResult>

 

Reply via email to