

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This document, authored by dr. Ye wu, explores the process of transferring binary data through jax-rpc using base64-encoding and soap attachments. It covers the creation of a soap message with an attachment, handling attachments in soap, and developing an axis service. The document also discusses the advantages and disadvantages of message handlers and handler chains, as well as the use of holder classes in jax-rpc.
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


sources: Java Web Service Architecture, James McGoven and etc., Morgan Kaufmann, Ch 4, 10, 11 (8 and 9 are supporting chapters) 2007-4-17 © Dr. Ye Wu 2
2007-4-17 © Dr. Ye Wu 3
Content-type:text/xml
Content-type:image/jpg …Image file…
2007-4-17 © Dr. Ye Wu 4
2007-4-17 © Dr. Ye Wu 5
public class ATServer{ public ATServer() { } public String UpLoadFile(javax.activation.DataHandler att) { try { att.writeTo(new FileOutputStream("ABC")); } catch (Exception e) { e.printStackTrace(); return "Error"; } return "OK"; } }
2007-4-17 © Dr. Ye Wu 6
QName qn = new QName("YW","DataHandler"); call.registerTypeMapping(DataHandler.class, qn, org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class, org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory.class); call.addParameter("inputfile", qn, ParameterMode.IN );
FileDataSource ds = new FileDataSource("ABC"); DataHandler handler = new DataHandler(ds); call.setReturnType(XMLType.XSD_STRING);
String rts = (String)call.invoke(new Object[]{handler});
2007-4-17 © Dr. Ye Wu 7
2007-4-17 © Dr. Ye Wu 8
2007-4-17 © Dr. Ye Wu 9
2007-4-17 © Dr. Ye Wu 11
public class MyclassHolder implements javax.xml.rpc.holders.Holder { // Order's object public Myclass value = null;
// default constructor public void MyclassHolder () { }
// constructor, which takes value as a parameter public void MyclassHolder (Myclass value) { this.value=value; } } 2007-4-17 © Dr. Ye Wu 12