Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Chiamata a WebService da eseguibile Java

    Ciao a tutti, volevo chiedervi se è possibile richiamare un webservice da un eseguibile java e non da una web application, per esigenze varie non è possibile utilizzare una web application ma solo un eseguibile, qln mi può dare delle indicazioni??
    Grazie mille spero di avere presto notizie!!!

  2. #2
    Puoi utilizzare la libreria Apache Axis: http://ws.apache.org/axis/java/

    Un esempio di codice per invocare un servizio da un client è questo:

    codice:
    Service service = new Service();
    Call call = ( Call ) service.createCall();
    call.setTargetEndpointAddress( new URL( "http://url/to/your/web/service" ) );
    call.setOperationName( new QName( "http://soapinterop.org/", "echoString" ) );
    String ret = ( String ) call.invoke( new Object[] { "Hello!" } );
    
    System.out.println( "Sent 'Hello!', got '" + ret + "'" );
    Ciao,

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.