package com.chinaztt.mes.common.gsm.in; 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 = "InStorageService", targetNamespace = "http://tempuri.org/", wsdlLocation = "http://192.168.20.25:8000/SalesServices/InStorageService.asmx?wsdl") public class InStorageService extends Service { private final static URL INSTORAGESERVICE_WSDL_LOCATION; private final static WebServiceException INSTORAGESERVICE_EXCEPTION; private final static QName INSTORAGESERVICE_QNAME = new QName("http://tempuri.org/", "InStorageService"); static { URL url = null; WebServiceException e = null; try { url = new URL(getServerWsdlLocationUrl()); } catch (MalformedURLException ex) { e = new WebServiceException(ex); } INSTORAGESERVICE_WSDL_LOCATION = url; INSTORAGESERVICE_EXCEPTION = e; } public InStorageService() { super(__getWsdlLocation(), INSTORAGESERVICE_QNAME); } public InStorageService(WebServiceFeature... features) { super(__getWsdlLocation(), INSTORAGESERVICE_QNAME, features); } public InStorageService(URL wsdlLocation) { super(wsdlLocation, INSTORAGESERVICE_QNAME); } public InStorageService(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, INSTORAGESERVICE_QNAME, features); } public InStorageService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public InStorageService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); } /** * * @return * returns InStorageServiceSoap */ @WebEndpoint(name = "InStorageServiceSoap") public InStorageServiceSoap getInStorageServiceSoap() { return super.getPort(new QName("http://tempuri.org/", "InStorageServiceSoap"), InStorageServiceSoap.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 InStorageServiceSoap */ @WebEndpoint(name = "InStorageServiceSoap") public InStorageServiceSoap getInStorageServiceSoap(WebServiceFeature... features) { return super.getPort(new QName("http://tempuri.org/", "InStorageServiceSoap"), InStorageServiceSoap.class, features); } /** * * @return * returns InStorageServiceSoap */ @WebEndpoint(name = "InStorageServiceSoap12") public InStorageServiceSoap getInStorageServiceSoap12() { return super.getPort(new QName("http://tempuri.org/", "InStorageServiceSoap12"), InStorageServiceSoap.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 InStorageServiceSoap */ @WebEndpoint(name = "InStorageServiceSoap12") public InStorageServiceSoap getInStorageServiceSoap12(WebServiceFeature... features) { return super.getPort(new QName("http://tempuri.org/", "InStorageServiceSoap12"), InStorageServiceSoap.class, features); } private static URL __getWsdlLocation() { if (INSTORAGESERVICE_EXCEPTION!= null) { throw INSTORAGESERVICE_EXCEPTION; } return INSTORAGESERVICE_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.inStorageService"); // if (StringUtils.isNotEmpty(wsdlLocation)) { // return wsdlLocation; // } else { return "http://192.168.20.25:8000/SalesServices/InStorageService.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; } }