简体   繁体   中英

JAX-WS XML file attachment

I am currently working on an web app which has web services allowing user to upload xml files to server. I am using JAX-WS to create web services. All examples I've seen describe uploading image files. Hence web service would contain a method like:

@WebMethod String uploadImage(Image data);

However, in case if I am uploading XML file what would be the type of arguments for that method?

@WebMethod String uploadXML(????? data);

I found answer to my question!

@WebMethod
public int uploadXML(DataHandler xmlData)

javax.activation.DataHandler has method getInputStream which contains the XML file sent as attachment

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM