You can store the wsdl locally and point that copy instead of the remote one.
Thanks for your response. My current code looks like
URL wsdlURL = new URL ( "http://www.example.com/example.asmx?WSDL"); QName serviceQName = new QName("http://www.example.com/example/", "Calculate"); Calculate calc = new Calculate(wsdlURL, serviceQName); CalculateSoap calcSoap = calc.getCalculateSoap(); calcSoap.execute();
It fails on Line 3 with a FileNotFoundException. If I use a WSDL stored locally will I have to modify the WSDL to point to the correct soap address in the following WSDL fragment at the very tail end of the WSDl to let it know where the service is hosted?
<wsdl:port CalculateSoap binding="tns:CalculateSoap"> <soap:address location="http://www.example.com/example.asmx" /> </wsdl:port>
Thanks for your help!
Never mind I figured out that the above way will work. The only problem is that I need to attach multiple WSDL's for different environments (dev, uat and prod) inside my ear and then use the logic to dynamically figure out which WSDL URL to load depending on environment.