Problème avec DataHandler et Web Service
Bonjour,
J'essaie de développer un web-service avec eclipse, glassfish et axis en se basant sur la classe suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
import java.net.MalformedURLException;
import java.net.URL;
import javax.activation.DataHandler;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlMimeType;
/**
*
* @author pc1
*/
@WebService()
public class WSFileSender {
@WebMethod( operationName = "getfile" )
public @XmlMimeType( "application/octet-stream" ) DataHandler getfile( @WebParam( name = "path" ) String path ) {
DataHandler datahandler = null;
try {
datahandler = new DataHandler( new URL( path ) );
}
catch ( MalformedURLException e ) {
System.out.println( "Bad" );
}
return datahandler;
}
} |
Mais quand la génération du web-service commence , je rencontre le warning suivant :
Citation:
The service class "WSFileSender" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
The method "getfile" on the service class "WSFileSender" uses a data type, "javax.activation.DataHandler", that is not supported by the JAX-RPC specification. Instances of the type may not serialize or deserialize correctly. Loss of data or complete failure of the Web service may result.
Que puis-je faire pour que je puisse résoudre ce problème s'il vous plait :roll: