我正在使用 JAX-WS 开发一个测试 WS,并且演示工作正常,但是如果我尝试将它移到生产环境中,我的代码上会出现很多测试环境的 URL。例如:
com.mycompany.testserver.ws.writer.WriterInterface service = new com.mycompany.testserver.ws.writer.WriterInterface();
QName portQName = new QName("http://testserver.mycompany.com/ws/writer.php", "WriterInterfacePort");
String req = "SOME_XML_HERE";
try { // Call Web Service Operation
Dispatch<Source> sourceDispatch = null;
sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req)));
} catch (Exception ex) [
//do stuff here
}
移动此类应用程序的最佳做法是什么?