I am developing integration with local delivery service and they gave me URL to WSDL files. One points to test environment and other to the production environment.
I would like to know if I really need to generate java files from both, or simply put, when deploying application to production, do I really need to generate files from production WSDL? Isn't there any way to just change endpoint from test to production?
I've also noticed that generated files from Eclipse and wsimport are not the same, for example using Eclipse, it doesn't generate ObjectFactory class.
You can use the same artifacts generated for both services if the only difference is the endpoint.
Example:
import java.net.URL;
public class Main {
public static void main(String[] args) throws Exception{
URL qaWsdl = new URL("http://tsteportal.posta.si/Services/eSpremnica.Wcf/eOddaja.svc");
URL prodWsdl = new URL("https://eportal.posta.si/Services/eSpremnica.Wcf/eOddaja.svc");
boolean isQA = Boolean.valueOf(args[0]);
//Pass whichever WSDL endpoint you need
EchoService service = new EchoService((isQA) ? qaWsdl : prodWsdl);
Echo port = service.getEchoPort();
}
}