[jboss-user] [JBossWS] - Re: WS-Attachment on jbossws

paoletto do-not-reply at jboss.com
Mon Jan 14 05:09:06 EST 2008


googled further, and found this on axis2 documentation:


  | /* Sample client which sends a message with SwA type attachments */
  | 
  |    public void uploadFileUsingSwA(String fileName) throws Exception {
  | 
  |         Options options = new Options();
  |         options.setTo(targetEPR);
  |         options.setProperty(Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
  |         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
  |         options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
  |         options.setTo(targetEPR);
  |   
  |         ServiceClient sender = new ServiceClient(null,null);
  |         sender.setOptions(options);
  |         OperationClient mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
  |         
  |         MessageContext mc = new MessageContext();   
  |         mc.setEnvelope(createEnvelope());
  |         FileDataSource fileDataSource = new FileDataSource("test-resources/mtom/test.jpg");
  |         DataHandler dataHandler = new DataHandler(fileDataSource);
  |         mc.addAttachment("FirstAttachment",dataHandler);
  |        
  |         mepClient.addMessageContext(mc);
  |         mepClient.execute(true);
  |     }
  | 

isnt it possible to do the same with jbossws?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119553#4119553

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119553



More information about the jboss-user mailing list