Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you need high performance, webservices are not great.</p> <p>You can try (Streaming SOAP Attachments):</p> <ul> <li><a href="http://docs.oracle.com/cd/E12840_01/wls/docs103/webserv_adv/mtom.html" rel="nofollow">http://docs.oracle.com/cd/E12840_01/wls/docs103/webserv_adv/mtom.html</a> </li> <li>example <a href="http://www.mkyong.com/webservices/jax-ws/jax-ws-attachment-with-mtom/" rel="nofollow">http://www.mkyong.com/webservices/jax-ws/jax-ws-attachment-with-mtom/</a></li> </ul> <p>File : ImageServer.java //Service Endpoint Interface</p> <pre><code>package com.mkyong.ws; import java.awt.Image; import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; @WebService @SOAPBinding(style = Style.RPC) public interface ImageServer{ //download a image from server @WebMethod Image downloadImage(String name); //update image to server @WebMethod String uploadImage(Image data); } //File : ImageServerImpl.java package com.mkyong.ws; import java.awt.Image; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.jws.WebService; import javax.xml.ws.WebServiceException; import javax.xml.ws.soap.MTOM; //Service Implementation Bean @MTOM @WebService(endpointInterface = "com.mkyong.ws.ImageServer") public class ImageServerImpl implements ImageServer{ @Override public Image downloadImage(String name) { try { File image = new File("c:\\images\\" + name); return ImageIO.read(image); } catch (IOException e) { e.printStackTrace(); return null; } } @Override public String uploadImage(Image data) { if(data!=null){ //store somewhere return "Upload Successful"; } throw new WebServiceException("Upload Failed!"); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload