package com.chinaztt.mes.common.gsm.out; import org.apache.commons.lang3.StringUtils; import java.io.File; import java.io.FileInputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Properties; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.2.9-b130926.1035 * Generated source version: 2.2 * */ @WebServiceClient(name = "OutStorageService", targetNamespace = "http://tempuri.org/", wsdlLocation = "http://192.168.20.25:8000/SalesServices/OutStorageService.asmx?wsdl") public class OutStorageService extends Service { private final static URL OUTSTORAGESERVICE_WSDL_LOCATION; private final static WebServiceException OUTSTORAGESERVICE_EXCEPTION; private final static QName OUTSTORAGESERVICE_QNAME = new QName("http://tempuri.org/", "OutStorageService"); static { URL url = null; WebServiceException e = null; try { url = new URL(getServerWsdlLocationUrl()); } catch (MalformedURLException ex) { e = new WebServiceException(ex); } OUTSTORAGESERVICE_WSDL_LOCATION = url; OUTSTORAGESERVICE_EXCEPTION = e; } public OutStorageService() { super(__getWsdlLocation(), OUTSTORAGESERVICE_QNAME); } public OutStorageService(WebServiceFeature... features) { super(__getWsdlLocation(), OUTSTORAGESERVICE_QNAME, features); } public OutStorageService(URL wsdlLocation) { super(wsdlLocation, OUTSTORAGESERVICE_QNAME); } public OutStorageService(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, OUTSTORAGESERVICE_QNAME, features); } public OutStorageService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public OutStorageService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); } /** * * @return * returns OutStorageServiceSoap */ @WebEndpoint(name = "OutStorageServiceSoap") public OutStorageServiceSoap getOutStorageServiceSoap() { return super.getPort(new QName("http://tempuri.org/", "OutStorageServiceSoap"), OutStorageServiceSoap.class); } /** * * @param features * A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. * @return * returns OutStorageServiceSoap */ @WebEndpoint(name = "OutStorageServiceSoap") public OutStorageServiceSoap getOutStorageServiceSoap(WebServiceFeature... features) { return super.getPort(new QName("http://tempuri.org/", "OutStorageServiceSoap"), OutStorageServiceSoap.class, features); } /** * * @return * returns OutStorageServiceSoap */ @WebEndpoint(name = "OutStorageServiceSoap12") public OutStorageServiceSoap getOutStorageServiceSoap12() { return super.getPort(new QName("http://tempuri.org/", "OutStorageServiceSoap12"), OutStorageServiceSoap.class); } /** * * @param features * A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. * @return * returns OutStorageServiceSoap */ @WebEndpoint(name = "OutStorageServiceSoap12") public OutStorageServiceSoap getOutStorageServiceSoap12(WebServiceFeature... features) { return super.getPort(new QName("http://tempuri.org/", "OutStorageServiceSoap12"), OutStorageServiceSoap.class, features); } private static URL __getWsdlLocation() { if (OUTSTORAGESERVICE_EXCEPTION!= null) { throw OUTSTORAGESERVICE_EXCEPTION; } return OUTSTORAGESERVICE_WSDL_LOCATION; } /** * 根据配置获取GSM地址路径 * * @return */ private static String getServerWsdlLocationUrl() { // String baseURL = getBaseURL(); // FileInputStream in = null; try { // in = new FileInputStream(baseURL + File.separator + "db.properties"); // Properties properties = new Properties(); // properties.load(in); // String wsdlLocation = properties.getProperty("gsm.update.outStorageService"); // if (StringUtils.isNotEmpty(wsdlLocation)) { // return wsdlLocation; // } else { return "http://192.168.20.25:8000/SalesServices/OutStorageService.asmx?WSDL"; // } } catch (Exception e) { e.printStackTrace(); } return null; } /** * 获取到db.properties的地址文件夹 * * @return */ private static String getBaseURL() { File directory = new File(""); String basePath = directory.getAbsolutePath(); basePath = basePath.substring(0, basePath.lastIndexOf(File.separator)) + File.separator + "qcadoo"; return basePath; } }