我正在使用Axis創建Web服務,並在運行時使用AdminClient在運行時部署我的Web服務。運行我的Java文件後,我可以用這個URL更改Axis Web服務的URL
http://127.0.0.1:8099/axis/services/MyWebService .
我想知道我怎麼能在運行時更改部署軸線我的web服務的URL來訪問我的web服務。 我想改變這種狀況網址爲
http://127.0.0.1:8099/MyWebService (OR) http://127.0.0.1:8099 .
我怎麼能這樣做?有什麼建議?
這是我的代碼。
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.ServerSocket;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.axis.transport.http.SimpleAxisServer;
public class AxisTest {
// start SimpleAxisServer
public AxisTest(){
}
public static void main(String[] args){
try {
int port = 8099;
SimpleAxisServer server = new SimpleAxisServer();
System.out.println("Opening server on port: "+ port);
ServerSocket ss = new ServerSocket(port);
ss.setSoTimeout(10000);
server.setServerSocket(ss);
server.start();
System.out.println("Starting server...");
// Read the deployment description of the service
String deploymenDescriptorFileName = "deploy.wsdd";
InputStream deploymentDescriptorStream = new FileInputStream(deploymenDescriptorFileName);
// Now deploy our web service
org.apache.axis.client.AdminClient adminClient;
adminClient = new org.apache.axis.client.AdminClient();
System.out.println("Deploying receiver server web service...");
String process = adminClient.process(
new org.apache.axis.utils.Options(new String[] {"-ddd","-tlocal"}),
deploymentDescriptorStream);
System.out.println("Process : "+process);
System.out.println("Server started. Waiting for connections on: " + port);
} catch (Exception ex) {
Logger.getLogger(AxisTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
你有一個WSDL – Keerthivasan
是的,我可以嗎?調用我的WSDL http://127.0.0.1:8099/axis/services/MyWebService?wsdl –
然後,你可以在其中編輯服務的端點 – Keerthivasan