Hi Dimuthu,

I apologize I do not know how to set optimizeParts or
deal with mtom policy.  If you could show me that
would help tremendously.

I'm using Axis2 1.1.1 and Rampart 1.1
The security part of the client code is taken from
rampart sample11.

The attachment is just a simple text file with "ABC"

ConfigurationContext configctx =
ConfigurationContextFactory.
        createConfigurationContextFromFileSystem(
                        "./src", "./src/conf/axis2.xml");

MTOMSampleStub serviceStub = new
MTOMSampleStub(configctx,
     
"http://localhost:8080/MTOMSample/services/MTOMSample";);

/**
 Construct datahandler & request object here
...
*/


OutflowConfiguration ofc = new OutflowConfiguration();
ofc.setUser("USER");
ofc.setActionItems("UsernameToken Timestamp");
ofc.setPasswordCallbackClass("PWCallbackHandler");
ofc.setPasswordType("PasswordText");

serviceStub._getServiceClient().getOptions().setProperty(
WSSHandlerConstants.OUTFLOW_SECURITY,
ofc.getProperty() );

serviceStub._getServiceClient().engageModule(new
QName("rampart"));
serviceStub._getServiceClient().getOptions().setProperty(Constants.ATTR_MUST_UNDERSTAND,
"0");

serviceStub._getServiceClient().getOptions().setProperty(
Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);

String response =
serviceStub.attachment(attachmentRequest).getAttachmentResponse();

TCPMonitor:
POST /MTOMSample/services/MTOMSample HTTP/1.1
User-Agent: Axis2
Host: 127.0.0.1:8080
Content-Length: 1719
Content-Type: multipart/related;
boundary=MIMEBoundaryurn_uuid_132853B9DEA885E7521184772489314;
type="application/xop+xml"; start="...

<soapenv:Header>
UsernameToken stuff...
</soapenv:Header>

<soapenv:Body>
...
<binaryData
xmlns:axis2ns1="http://www.w3.org/2005/05/xmlmime";
axis2ns1:contentType="text/plain"><base64Binary
xmlns="http://www.w3.org/2001/XMLSchema";>QUJD</base64Binary></binaryData>

--Attachment is not optimized but left as base64
encoded - "QUJD"

Thanks a million.
Giao

--- Dimuthu <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Did you specify the optimize parts element
> "OptimizeParts" with the
> xpaths?
> 
> Did you specify the mtom policy as
> <wsoma:OptimizedMimeSerialization/> ?
> 
> What version of rampart are u using?
> 
> If the problem exist, please file a JIRA. 
> 
> Regards,
> Dimuthu
> 
> 
> 
> On Tue, 2007-07-17 at 15:00 +0530, Thilina
> Gunarathne wrote:
> > May be rampart guys can  answer this better...
> > 
> > Thanks,
> > Thilina
> > 
> > ---------- Forwarded message ----------
> > From: Giao <[EMAIL PROTECTED]>
> > Date: Jul 16, 2007 9:19 PM
> > Subject: MTOM & WS Securit
> > To: [EMAIL PROTECTED]
> > 
> > 
> > Hi,
> > 
> > We use Axis 1.3 and SWA on the server side in
> > production.  We're starting to develop using Axis2
> > because of MTOM support and .NET client
> compatibility.
> > 
> > We have successfully tested both Axis2 and
> .NET/WSE
> > 3.0 clients against the MTOM Sample app.
> > 
> > Once I enable security with
> > "ServiceClient.engageModule(new QName("rampart")) 
> the
> > outgoing message has the attachment in-line (in
> XML
> > envelope) and
> >  base64 encoded, rather than has the expected
> > <xop:Include href="cid...">  Also the content
> length
> > now is 33% larger because of base64 encoding.  It
> > still works, although the capacity is now limited
> to
> > about 20MB before the server gets an out of memory
> > error.  Previously I was testing with about 50MB.
> > 
> > I didn't see any mention in the OASIS WSS v1.0
> specs
> > about MTOM.
> > 
> > Is there any way around this limitation?
> > 
> > 
> > Thanks in advance,
> > Giao
> > 
> > 
> > 
> > 
> >
>
____________________________________________________________________________________
> > Got a little couch potato?
> > Check out fun summer activities for kids.
> >
>
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> 


Giao


       
____________________________________________________________________________________Ready
 for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

Reply via email to