Please try enabling MTOM in the Axis2.xml... The axis2.xml which you
have provided does not have MTOM enabled..
Hope you are using TCPMON to sniff the messages...
~Thilina
On 2/13/07, donald yang <[EMAIL PROTECTED]> wrote:
Hi Thilina,
Many thanks for your reply. I have alreay enable MTOM in the
axis2.xml. But the binary data is still sent by value not by reference
regardless the binary data is sent from client or server. I am attaching my
axis2.xml and service.xml, could you please give me a hand?
best regards
donald
On 2/13/07, Thilina Gunarathne < [EMAIL PROTECTED]> wrote:
>
> Hi Donald,
> It is a known issue with Axis2 SOAP monitor.. Axis TCPMON is now
> separated out in to a ws-commons project [1].
>
> Please enable MTOM in the Axis2.xml of the server or in the
> service.xml of your service.
> More info [2].
>
> Thanks,
> Thilina
> [1]http://ws.apache.org/commons/tcpmon/
> [2] http://wso2.org/library/264
>
> On 2/13/07, donald yang <[EMAIL PROTECTED]> wrote:
> > Hi Thilina,
> >
> > I sent the binary data to my test web service using the source
code
> > posted in my previous email. I found that the SOAP messages I got using
> > different montior is different. In the SOAP message[1] obtained using
> > AXIS1.4 TCPMon, the binary data is sent by reference. In the SOAP
message
> > [2] obtained using AXIS2-1.1.1 SOAPMonitor, the binary data is sent by
> > value. I don't know why they are different.
> >
> > I also encounter another problem. I can't sent back binary data by
> > reference from web service to client. I use both monitors, I saw the
binary
> > data is sent by value in both SOAP messages. I have enable MTOM in
> > axis2.xml. Could you please give me some suggestions?
> >
> > Many thanks in advance.
> >
> > best regards
> > donald
> >
> > [1] SOAP message I got using AXIS1.4 TCPMon
> >
> > POST /axis2/services/TestService HTTP/1.1
> > SOAPAction: "urn:anonOutInOp"
> > User-Agent: Axis2
> > Host: localhost:9000
> > Transfer-Encoding: chunked
> > Content-Type: multipart/related;
> >
boundary=MIMEBoundaryurn_uuid_A9972CA35225AAC2E311713669497501;
> > type="application/xop+xml"; start="<
> > 0.urn:uuid:[EMAIL PROTECTED]
>";
> > start-info="text/xml"; charset=UTF-8
> > 3c4
> > --MIMEBoundaryurn_uuid_A9972CA35225AAC2E311713669497501
> > content-type: application/xop+xml; charset=UTF-8; type="text/xml";
> > content-transfer-encoding: binary
> > content-id:
> > <
0.urn:uuid:[EMAIL PROTECTED]
> > >
> > <?xml version='1.0' encoding='UTF-8'?>
> > <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/ ">
> > <soapenv:Header />
> > <soapenv:Body>
> > <test1:transferMessage xmlns:test1="
> > http://ws.apache.org/axis2/xsd ">
> > <test1:name>d:\dest.txt</test1:name>
> > <test1:attachment>
> > <xop:Include href="cid:
> > 1.urn:uuid:[EMAIL PROTECTED]"
> > xmlns:xop="http://www.w3.org/2004/08/xop/include " />
> > </test1:attachment>
> > </test1:transferMessage>
> > </soapenv:Body>
> >
> >
</soapenv:Envelope>--MIMEBoundaryurn_uuid_A9972CA35225AAC2E311713669497501content-type:
> > text/plaincontent-transfer-encoding: binarycontent-id:
> >
> >
<1.urn:uuid:[EMAIL
PROTECTED]>hello--MIMEBoundaryurn_uuid_A9972CA35225AAC2E311713669497501--0
> >
> >
> > [2] SOAP message I got using AXIS1.1.1 SOAPMontior
> > <test1:transferMessage xmlns:test1="http://ws.apache.org/axis2/xsd ">
> > <test1:name>d:\dest.txt</test1:name>
> > <test1:attachment>aGVsbG8=</test1:attachment>
> > </test1:transferMessage>
> >
> > When I decode "aGVsbG8=", the value is "hello" which is content of the
file
> > I sent to web service.
> >
> > [3] code to send attachment from server to client
> > public class TransferResponse
> > {
> >
> > private OMElement downloadFile;
> >
> > ........................
> >
> > public void setDownloadFile(String fileName)
> > {
> >
> > OMFactory fac = OMAbstractFactory.getOMFactory();
> > OMNamespace omNs = fac.createOMNamespace(
> > " http://ws.apache.org/axis2/xsd", "test1");
> > downloadFile = fac.createOMElement("downloadFile", omNs);
> > DataHandler dataHandler = new DataHandler(new
> > FileDataSource("d:\\test.txt"));
> > OMText textData = fac.createOMText(dataHandler, true);
> > textData.setOptimize(true);
> > downloadFile.addChild(textData);
> > }
> >
> > }
> >
>
>
> --
> Thilina Gunarathne
> WSO2, Inc.; http://www.wso2.com/
> Home page: http://webservices.apache.org/~thilina/
> Blog: http://thilinag.blogspot.com/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]