axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Axis2 SWA client communicating Axis2 MTOM service
Date Tue, 09 Oct 2007 13:29:11 GMT

I would like to answer my question for benifit of others.  I solved my 
issue well now. 
If wrong just correct it

1)  While using SWA we need to use  OperationClient API at client side. 
using MessageContext on service side to attach a attachment . Don't forget 
to send messageId back as pay load so that you can extract  actual 
attachment client side.
2) Yes caching is supported while using SWA.
3) if SOAP 1.2 version works with SWA ? I need to to try yet.

10/08/2007 03:12 PM
Please respond to


Re: Axis2 SWA client communicating Axis2 MTOM service

Thanks for insight   
Sorry but two small question. 
1) For enabling SWA do  i need to do any changes on service code or 
Just changing axis conf file is ok 
  <parameter name="enableMTOM" locked="false">false</parameter> 
  <parameter name="enableSwA" locked="false">true</parameter> 

As I see in SWA sample I see usage of MessageContext Variable and usage of 
OMelement variables/SenderClient at client side.In my case we really don't 
use them. or it will be transparent to me if I use stub client. 

2) Is use of SOAP 1.2 is ok ? in sample i see 

2) Caching is supported in SWA? 


"Thilina Gunarathne" <> 
10/08/2007 01:22 PM 

Please respond to


Re: Axis2 SWA client communicating Axis2 MTOM service

> I have a web service running with AXIS2 with MTOM and I am trying to
> communicate it with  Axis2 Client with SWA enabled ( Soap with 
> Is this possible to do ?
Nope.. Not if you are going to use the MTOM binding features, such as
automatic binding of bianry attachments to the XML tree... Things will
fail miserably if you r using data binding to generate the service
skeleton, as the message no longer conforms to the schema.

You can access the attachments using the attachments API..But then you
are essentially doing SwA in the server side.. Also you won't be able
to use data binding.

> Reason I need to do it as  I am using ALSB 2.6   in between which does 
> support MTOM.
> If yes  Can any one tell me what is wrong in this SOAP response received 
> client. It fails with ClassCastException at client side.   I am having
> problem at client side .
Looking at the source you pasted below, you seems to be using data
binding together with a WSDL which has base64Binary in it. Your
response is SwA, which does not conforms to the data bounded schema.
Also the response message is broken, as it's header tells that it's
SwA, but the body has XOP:include.

Mixing SwA with MTOM when data binding is used is not a good idea..


>I tried to debug found It try to cast
> getBuilder() to
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder
> which is not in actually for my binaryData node.
> I am finding difficult why  it try to use MTOMstax event I enabled only 
> at client side.  If you can make anything out of SOAP message what is 
> let me know.
> My Stub setting
> EMISEPServiceStub serviceStub = new
> EMISEPServiceStub("http://localhost:8085/EMISProxyService");
> serviceStub._getServiceClient().getOptions().setProperty(
>         Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_FALSE);
> serviceStub._getServiceClient().getOptions().setProperty(
> Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
> SOAP message response
> HTTP/1.1 200 OK
> Date: Mon, 08 Oct 2007 14:32:13 GMT
> Transfer-Encoding: chunked
> Content-Type: multipart/related; type="application/soap+xml";
> start="";
>         boundary=MIME_Boundary; charset=UTF-8
> X-Powered-By: Servlet/2.4 JSP/2.0
> 0670
> --MIME_Boundary
> Content-ID:
> Content-Type: application/soap+xml; charset=utf-8
> Content-Transfer-Encoding: 8bit
> <?xml version='1.0' encoding='utf-8'?>
>    <soapenv:Envelope
> xmlns:soapenv="">
>       <soapenv:Body>
>          <ns1:getFileResponse
> xmlns:ns1="">
>             <ns1:method>getFile</ns1:method>
>             <ns1:parameters>
>                <ns1:FileDataInfo>
> <ns1:fileExtension>txt</ns1:fileExtension>
> <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
>                   <ns1:fileName>test</ns1:fileName>
>                   <ns1:folderName>c:\TEMP</ns1:folderName>
>                   <ns1:scriptName>*</ns1:scriptName>
>                   <ns1:attachment>
>                      <ns1:size>1231</ns1:size>
>                      <ns1:checksum>1231</ns1:checksum>
>                   </ns1:attachment>
>                </ns1:FileDataInfo>
>             </ns1:parameters>
>             <ns1:response>
>                <ns1:attachment>
>                   <ns1:binaryNode>
>                      <xop:Include
> href=""
> xmlns:xop="" />
>                   </ns1:binaryNode>
>                   <ns1:size>121</ns1:size>
>                   <ns1:checksum>121</ns1:checksum>
>                </ns1:attachment>
> <ns1:responseStatus>true</ns1:responseStatus>
>                <ns1:hasAttachment>true</ns1:hasAttachment>
>             </ns1:response>
>             <ns1:EPInfo>
>                <ns1:node>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:node>
>                <ns1:system>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:system>
>             </ns1:EPInfo>
>             <ns1:currentInterface>
>                <ns1:name>sdfa</ns1:name>
>                <ns1:id>12</ns1:id>
>             </ns1:currentInterface>
>          </ns1:getFileResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>--MIME_BoundaryContent-Type:
> text/plainContent-Transfer-Encoding: binaryContent-ID:
> <>Test
> Data created by 12:00 at 10/4/2007  to test attachment at
> ALSB0015--MIME_Boundary--0000
> Exception stack trace.  I am getting.
> java.lang.ClassCastException:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
>         at
>         at
>         at
>         at
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(
>         at
>         at
>         at
>         at
> com.mizuho.yogesh.NoWeblogic.main(
> org.apache.axis2.AxisFault:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> org.apache.axis2.AxisFault.makeFault(
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(
>         at
> Thanks
> Regards
> Yogesh Dhake
>  This transmittal and any attachments may contain confidential, 
> or sensitive information and is solely for the use of the intended
> recipient. If you are not the intended recipient, you are hereby 
> that you have received this transmittal and any attachments in error and 
> review, dissemination, distribution or copying thereof is strictly
> prohibited. If you have received this transmittal and any attachments in
> error please notify the sender and immediately destroy the message and 
> its attachments. Any opinions herein expressed may be those of the 
> and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate 
> (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho
> Financial Group ("Mizuho"). Mizuho accepts no responsibility for the
> accuracy or completeness of any information herein contained.
>  E-Mail received by or sent from officer of Mizuho Securities USA Inc.
> (which is a registered U.S. broker-dealer and the entity through which
> Mizuho generally conducts its investment banking, capital markets, and
> securities business in the United States) is electronically archived and
> recorded and is subject to review and monitoring by and/or disclosure to
> persons other than the recipient, including (but not limited to) Mizuho
> Securities USA Inc. supervisory personnel. Such communications may be
> produced to regulatory authorities or others with legal rights to the
> information.

Thilina Gunarathne  -

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message