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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
package mainPack;
import java.net.MalformedURLException;
import java.net.URL;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
import org.apache.wsif.WSIFException;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;
import org.apache.wsif.util.WSIFUtils;
public class MainClass {
/**
* @param args
*/
// aller voir http://kickjava.com/src/wsdl/ClassLoaderTest.java.htm
public static void main(String[] args) {
// TODO Raccord de méthode auto-généré
Definition _WSDLDef = null;
URL url = null;
// Structurer l'URL
try {
url = new URL("http://localhost:8080/axis/services/allo?wsdl");//"http://www.turbojugend-kuopio.com/ws/Laskin.wsdl");
} catch (MalformedURLException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
}
System.out.println("Generate Definition of : "+url.getFile().toString());
// Extraire la definition
try {
_WSDLDef = WSIFUtils.readWSDL(null, url.toString());
/*url.toString(),
_wsdlDocument);*/
} catch (WSDLException e1) {
// TODO Bloc catch auto-généré
e1.printStackTrace();
}
try {
WSIFService sq = WSIFServiceFactory.newInstance().getService(_WSDLDef);
} catch (WSIFException e) {
// TODO Bloc catch auto-généré
e.printStackTrace();
}
System.out.println("OK");
}
} |