Index: ssts-client-misc/src/main/java/org/tempuri/HisWebService.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisWebService.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisWebService.java (revision 20233) @@ -0,0 +1,16 @@ +/** + * HisWebService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public interface HisWebService extends javax.xml.rpc.Service { + public java.lang.String getHisWebServiceSoapAddress(); + + public org.tempuri.HisWebServiceSoap getHisWebServiceSoap() throws javax.xml.rpc.ServiceException; + + public org.tempuri.HisWebServiceSoap getHisWebServiceSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} Index: ssts-client-misc/src/main/java/org/tempuri/HisUserLoginResponseHisUserLoginResult.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisUserLoginResponseHisUserLoginResult.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisUserLoginResponseHisUserLoginResult.java (revision 20233) @@ -0,0 +1,121 @@ +/** + * HisUserLoginResponseHisUserLoginResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public class HisUserLoginResponseHisUserLoginResult implements java.io.Serializable, org.apache.axis.encoding.AnyContentType, org.apache.axis.encoding.MixedContentType { + private org.apache.axis.message.MessageElement [] _any; + + public HisUserLoginResponseHisUserLoginResult() { + } + + public HisUserLoginResponseHisUserLoginResult( + org.apache.axis.message.MessageElement [] _any) { + this._any = _any; + } + + + /** + * Gets the _any value for this HisUserLoginResponseHisUserLoginResult. + * + * @return _any + */ + public org.apache.axis.message.MessageElement [] get_any() { + return _any; + } + + + /** + * Sets the _any value for this HisUserLoginResponseHisUserLoginResult. + * + * @param _any + */ + public void set_any(org.apache.axis.message.MessageElement [] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof HisUserLoginResponseHisUserLoginResult)) return false; + HisUserLoginResponseHisUserLoginResult other = (HisUserLoginResponseHisUserLoginResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any==null && other.get_any()==null) || + (this._any!=null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i=0; + i>HisUserLoginResponse>HisUserLoginResult")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} Index: ssts-client-misc/src/main/java/org/tempuri/HisWebServiceLocator.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisWebServiceLocator.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisWebServiceLocator.java (revision 20233) @@ -0,0 +1,144 @@ +/** + * HisWebServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +import com.forgon.disinfectsystem.security.service.zjyy.WebServiceClientHelper; + +public class HisWebServiceLocator extends org.apache.axis.client.Service implements org.tempuri.HisWebService { + + public HisWebServiceLocator() { + } + + + public HisWebServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public HisWebServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for HisWebServiceSoap + private java.lang.String HisWebServiceSoap_address = WebServiceClientHelper.wsUrl; + + public java.lang.String getHisWebServiceSoapAddress() { + return HisWebServiceSoap_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String HisWebServiceSoapWSDDServiceName = "HisWebServiceSoap"; + + public java.lang.String getHisWebServiceSoapWSDDServiceName() { + return HisWebServiceSoapWSDDServiceName; + } + + public void setHisWebServiceSoapWSDDServiceName(java.lang.String name) { + HisWebServiceSoapWSDDServiceName = name; + } + + public org.tempuri.HisWebServiceSoap getHisWebServiceSoap() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(HisWebServiceSoap_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getHisWebServiceSoap(endpoint); + } + + public org.tempuri.HisWebServiceSoap getHisWebServiceSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + org.tempuri.HisWebServiceSoapStub _stub = new org.tempuri.HisWebServiceSoapStub(portAddress, this); + _stub.setPortName(getHisWebServiceSoapWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setHisWebServiceSoapEndpointAddress(java.lang.String address) { + HisWebServiceSoap_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (org.tempuri.HisWebServiceSoap.class.isAssignableFrom(serviceEndpointInterface)) { + org.tempuri.HisWebServiceSoapStub _stub = new org.tempuri.HisWebServiceSoapStub(new java.net.URL(HisWebServiceSoap_address), this); + _stub.setPortName(getHisWebServiceSoapWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("HisWebServiceSoap".equals(inputPortName)) { + return getHisWebServiceSoap(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://tempuri.org/", "HisWebService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://tempuri.org/", "HisWebServiceSoap")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("HisWebServiceSoap".equals(portName)) { + setHisWebServiceSoapEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} Index: ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/SSOAuthenticationServiceImpl.java =================================================================== diff -u -r20222 -r20233 --- ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/SSOAuthenticationServiceImpl.java (.../SSOAuthenticationServiceImpl.java) (revision 20222) +++ ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/SSOAuthenticationServiceImpl.java (.../SSOAuthenticationServiceImpl.java) (revision 20233) @@ -15,13 +15,10 @@ public class SSOAuthenticationServiceImpl implements SSOAuthenticationService { - private static final String WSDL_URL = "http://136.168.200.32:8384/HisService/HisService.asmx"; - - private static final String SUCC = "1"; - @Override public boolean authentication(String username, String password, String type) throws Exception { - String userNameBase64 = Base64.getEncoder().encodeToString(username.getBytes()); + //珠江医院的webservice不支持http post方式调用 + /*String userNameBase64 = Base64.getEncoder().encodeToString(username.getBytes()); String passwordBase64 = Base64.getEncoder().encodeToString(password.getBytes()); boolean isValidUser = false; String inputParam = "" + @@ -34,12 +31,18 @@ "" + ""; - String result = CssdUtils.sendPostRequest(WSDL_URL, inputParam, Constants.CHARSET_UTF8); + String result = CssdUtils.sendPostRequest(WebServiceClientHelper.wsUrl, inputParam, Constants.CHARSET_UTF8); String rtncode = CssdUtils.getXmlContentByTagName(result, "rtncode"); - if(SUCC.equals(rtncode)){ + if(WebServiceClientHelper.SUCC.equals(rtncode)){ isValidUser = true; + }*/ + boolean result = false; + try{ + result = WebServiceClientHelper.authenticationLogon(username, password); + }catch(RuntimeException e){ + throw e; } - return isValidUser; + return result; } } Index: ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/WebServiceClientHelper.java =================================================================== diff -u --- ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/WebServiceClientHelper.java (revision 0) +++ ssts-client-misc/src/main/java/com/forgon/disinfectsystem/security/service/zjyy/WebServiceClientHelper.java (revision 20233) @@ -0,0 +1,78 @@ +package com.forgon.disinfectsystem.security.service.zjyy; + +import java.rmi.RemoteException; +import java.util.Base64; +import java.util.Base64.Encoder; + +import net.sf.json.JSONObject; + +import org.apache.axis.message.MessageElement; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.tempuri.GetUserListResponseGetUserListResult; +import org.tempuri.HisUserLoginResponseHisUserLoginResult; +import org.tempuri.HisWebServiceSoap; +import org.tempuri.HisWebServiceSoapProxy; + +import com.forgon.disinfectsystem.common.CssdUtils; + +/** + * 珠江医院webservice帮助类 + * @author shuyongfu + * @since 2017-10-09 + * + */ +public class WebServiceClientHelper { + + private static Logger logger = Logger.getLogger(WebServiceClientHelper.class); + + /** + * sso统一身份认证平台的webservice接口地址 + */ + public final static String wsUrl = "http://136.168.200.32:8384/HisService/HisService.asmx"; + + /** + * 返回成功的常量定义 + */ + private static final String SUCC = "1"; + + /** + * 单点登录认证方法(需要对登录名和密码的明文进行base64编码后进行统一身份认证) + * @param username 登录名(明文) + * @param password 登录密码(明文) + * @return + */ + public static boolean authenticationLogon(String username, String password){ + boolean success = false; + Encoder base64Encoder = Base64.getEncoder(); + String userNameBase64 = base64Encoder.encodeToString(username.getBytes()); + String passwordBase64 = base64Encoder.encodeToString(password.getBytes()); + HisWebServiceSoap hisWebServiceSoap = new HisWebServiceSoapProxy(); + try { + logger.debug("珠江医院单点登录接口参数 username="+ username +",password="+ password +",base64编码后username="+ userNameBase64 +",password=" + passwordBase64); + HisUserLoginResponseHisUserLoginResult result = hisWebServiceSoap.hisUserLogin(userNameBase64, passwordBase64); + logger.debug("珠江医院单点登录接口返回 result.get_any()=" + result.get_any()); + //logger.debug("珠江医院单点登录接口返回 JSONObject.fromObject(result)=" + JSONObject.fromObject(result)); + MessageElement[] messagemElementArray = result.get_any(); + if(messagemElementArray != null && messagemElementArray.length > 0){ + logger.debug("珠江医院单点登录接口返回 messagemElementArray[0]=" + messagemElementArray[0]); + String rtnCode = CssdUtils.getXmlContentByTagName(messagemElementArray[0].getAsDocument(), "rtncode"); + success = StringUtils.equals(SUCC, rtnCode); + if(!success){ + String msg = CssdUtils.getXmlContentByTagName(messagemElementArray[0].getAsDocument(), "msg"); + if(StringUtils.isNotBlank(msg)){ + throw new RuntimeException(msg); + } + } + } + } catch (RemoteException e) { + e.printStackTrace(); + logger.error("珠江医院单点登录接口出现异常RemoteException=" + e); + } catch (Exception e) { + e.printStackTrace(); + logger.error("珠江医院单点登录接口出现异常Exception=" + e); + } + return success; + } + +} Index: ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapStub.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapStub.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapStub.java (revision 20233) @@ -0,0 +1,249 @@ +/** + * HisWebServiceSoapStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public class HisWebServiceSoapStub extends org.apache.axis.client.Stub implements org.tempuri.HisWebServiceSoap { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[2]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("HisUserLogin"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "strUserID"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + param.setOmittable(true); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "strUserPWD"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + param.setOmittable(true); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://tempuri.org/", ">>HisUserLoginResponse>HisUserLoginResult")); + oper.setReturnClass(org.tempuri.HisUserLoginResponseHisUserLoginResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://tempuri.org/", "HisUserLoginResult")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("GetUserList"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "strUserID"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + param.setOmittable(true); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "strUserPWD"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + param.setOmittable(true); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://tempuri.org/", ">>GetUserListResponse>GetUserListResult")); + oper.setReturnClass(org.tempuri.GetUserListResponseGetUserListResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://tempuri.org/", "GetUserListResult")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[1] = oper; + + } + + public HisWebServiceSoapStub() throws org.apache.axis.AxisFault { + this(null); + } + + public HisWebServiceSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public HisWebServiceSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://tempuri.org/", ">>GetUserListResponse>GetUserListResult"); + cachedSerQNames.add(qName); + cls = org.tempuri.GetUserListResponseGetUserListResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://tempuri.org/", ">>HisUserLoginResponse>HisUserLoginResult"); + cachedSerQNames.add(qName); + cls = org.tempuri.HisUserLoginResponseHisUserLoginResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://tempuri.org/", ">GetUserList"); + cachedSerQNames.add(qName); + cls = org.tempuri.GetUserList.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://tempuri.org/", ">GetUserListResponse"); + cachedSerQNames.add(qName); + cls = org.tempuri.GetUserListResponse.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public org.tempuri.HisUserLoginResponseHisUserLoginResult hisUserLogin(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://tempuri.org/HisUserLogin"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/", "HisUserLogin")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {strUserID, strUserPWD}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.tempuri.HisUserLoginResponseHisUserLoginResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.tempuri.HisUserLoginResponseHisUserLoginResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.tempuri.HisUserLoginResponseHisUserLoginResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; +} + } + + public org.tempuri.GetUserListResponseGetUserListResult getUserList(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://tempuri.org/GetUserList"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/", "GetUserList")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {strUserID, strUserPWD}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.tempuri.GetUserListResponseGetUserListResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.tempuri.GetUserListResponseGetUserListResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.tempuri.GetUserListResponseGetUserListResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; +} + } + +} Index: ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoap.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoap.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoap.java (revision 20233) @@ -0,0 +1,21 @@ +/** + * HisWebServiceSoap.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public interface HisWebServiceSoap extends java.rmi.Remote { + + /** + *
说明:需Base64加密 + */ + public org.tempuri.HisUserLoginResponseHisUserLoginResult hisUserLogin(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException; + + /** + *
说明:需Base64加密 + */ + public org.tempuri.GetUserListResponseGetUserListResult getUserList(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException; +} Index: ssts-client-misc/src/main/java/org/tempuri/GetUserList.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/GetUserList.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/GetUserList.java (revision 20233) @@ -0,0 +1,157 @@ +/** + * GetUserList.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public class GetUserList implements java.io.Serializable { + private java.lang.String strUserID; + + private java.lang.String strUserPWD; + + public GetUserList() { + } + + public GetUserList( + java.lang.String strUserID, + java.lang.String strUserPWD) { + this.strUserID = strUserID; + this.strUserPWD = strUserPWD; + } + + + /** + * Gets the strUserID value for this GetUserList. + * + * @return strUserID + */ + public java.lang.String getStrUserID() { + return strUserID; + } + + + /** + * Sets the strUserID value for this GetUserList. + * + * @param strUserID + */ + public void setStrUserID(java.lang.String strUserID) { + this.strUserID = strUserID; + } + + + /** + * Gets the strUserPWD value for this GetUserList. + * + * @return strUserPWD + */ + public java.lang.String getStrUserPWD() { + return strUserPWD; + } + + + /** + * Sets the strUserPWD value for this GetUserList. + * + * @param strUserPWD + */ + public void setStrUserPWD(java.lang.String strUserPWD) { + this.strUserPWD = strUserPWD; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof GetUserList)) return false; + GetUserList other = (GetUserList) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.strUserID==null && other.getStrUserID()==null) || + (this.strUserID!=null && + this.strUserID.equals(other.getStrUserID()))) && + ((this.strUserPWD==null && other.getStrUserPWD()==null) || + (this.strUserPWD!=null && + this.strUserPWD.equals(other.getStrUserPWD()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getStrUserID() != null) { + _hashCode += getStrUserID().hashCode(); + } + if (getStrUserPWD() != null) { + _hashCode += getStrUserPWD().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(GetUserList.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", ">GetUserList")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("strUserID"); + elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "strUserID")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("strUserPWD"); + elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "strUserPWD")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} Index: ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapProxy.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapProxy.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/HisWebServiceSoapProxy.java (revision 20233) @@ -0,0 +1,60 @@ +package org.tempuri; + +public class HisWebServiceSoapProxy implements org.tempuri.HisWebServiceSoap { + private String _endpoint = null; + private org.tempuri.HisWebServiceSoap hisWebServiceSoap = null; + + public HisWebServiceSoapProxy() { + _initHisWebServiceSoapProxy(); + } + + public HisWebServiceSoapProxy(String endpoint) { + _endpoint = endpoint; + _initHisWebServiceSoapProxy(); + } + + private void _initHisWebServiceSoapProxy() { + try { + hisWebServiceSoap = (new org.tempuri.HisWebServiceLocator()).getHisWebServiceSoap(); + if (hisWebServiceSoap != null) { + if (_endpoint != null) + ((javax.xml.rpc.Stub)hisWebServiceSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + else + _endpoint = (String)((javax.xml.rpc.Stub)hisWebServiceSoap)._getProperty("javax.xml.rpc.service.endpoint.address"); + } + + } + catch (javax.xml.rpc.ServiceException serviceException) {} + } + + public String getEndpoint() { + return _endpoint; + } + + public void setEndpoint(String endpoint) { + _endpoint = endpoint; + if (hisWebServiceSoap != null) + ((javax.xml.rpc.Stub)hisWebServiceSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + + } + + public org.tempuri.HisWebServiceSoap getHisWebServiceSoap() { + if (hisWebServiceSoap == null) + _initHisWebServiceSoapProxy(); + return hisWebServiceSoap; + } + + public org.tempuri.HisUserLoginResponseHisUserLoginResult hisUserLogin(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException{ + if (hisWebServiceSoap == null) + _initHisWebServiceSoapProxy(); + return hisWebServiceSoap.hisUserLogin(strUserID, strUserPWD); + } + + public org.tempuri.GetUserListResponseGetUserListResult getUserList(java.lang.String strUserID, java.lang.String strUserPWD) throws java.rmi.RemoteException{ + if (hisWebServiceSoap == null) + _initHisWebServiceSoapProxy(); + return hisWebServiceSoap.getUserList(strUserID, strUserPWD); + } + + +} \ No newline at end of file Index: ssts-client-misc/src/main/java/org/tempuri/GetUserListResponse.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/GetUserListResponse.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/GetUserListResponse.java (revision 20233) @@ -0,0 +1,120 @@ +/** + * GetUserListResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public class GetUserListResponse implements java.io.Serializable { + private org.tempuri.GetUserListResponseGetUserListResult getUserListResult; + + public GetUserListResponse() { + } + + public GetUserListResponse( + org.tempuri.GetUserListResponseGetUserListResult getUserListResult) { + this.getUserListResult = getUserListResult; + } + + + /** + * Gets the getUserListResult value for this GetUserListResponse. + * + * @return getUserListResult + */ + public org.tempuri.GetUserListResponseGetUserListResult getGetUserListResult() { + return getUserListResult; + } + + + /** + * Sets the getUserListResult value for this GetUserListResponse. + * + * @param getUserListResult + */ + public void setGetUserListResult(org.tempuri.GetUserListResponseGetUserListResult getUserListResult) { + this.getUserListResult = getUserListResult; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof GetUserListResponse)) return false; + GetUserListResponse other = (GetUserListResponse) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.getUserListResult==null && other.getGetUserListResult()==null) || + (this.getUserListResult!=null && + this.getUserListResult.equals(other.getGetUserListResult()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getGetUserListResult() != null) { + _hashCode += getGetUserListResult().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(GetUserListResponse.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", ">GetUserListResponse")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("getUserListResult"); + elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/", "GetUserListResult")); + elemField.setXmlType(new javax.xml.namespace.QName("http://tempuri.org/", ">>GetUserListResponse>GetUserListResult")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} Index: ssts-web/src/main/java/com/forgon/disinfectsystem/security/userdetails/DaoUserDetailSSTSImpl.java =================================================================== diff -u -r20222 -r20233 --- ssts-web/src/main/java/com/forgon/disinfectsystem/security/userdetails/DaoUserDetailSSTSImpl.java (.../DaoUserDetailSSTSImpl.java) (revision 20222) +++ ssts-web/src/main/java/com/forgon/disinfectsystem/security/userdetails/DaoUserDetailSSTSImpl.java (.../DaoUserDetailSSTSImpl.java) (revision 20233) @@ -71,6 +71,9 @@ @Resource private OrgUnitManager orgUnitManager; + /** + * 单点登录service,此处不能用@Resource或@Autowired注解,因为这个bean所在的project不是任何项目都会依赖的,没有依赖时会报ClassNotFound + */ private SSOAuthenticationService ssoAuthenticationService; // public void setSysUserManager(SysUserManager sysUserManager) { @@ -115,7 +118,7 @@ } HttpServletRequest request = null; if(requestAttributes != null){ - request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); + request = ((ServletRequestAttributes)requestAttributes).getRequest(); } username = username.toLowerCase();// 登录不区分大小写 @@ -150,6 +153,7 @@ String password = currentLoginedUser.getPasswd(); if(ssoAuthenticationService != null){ boolean succ = false; + String message = "帐号" + username + "单点登录认证失败"; try { password = request.getParameter("j_password"); succ = ssoAuthenticationService.authentication(username, password, null); @@ -160,11 +164,14 @@ } catch (Exception e) { throw new RuntimeException("计算材料MD5出错!" + e.getMessage()); } + } catch (RuntimeException e) { + e.printStackTrace(); + message += "," + e.getMessage(); } catch (Exception e) { e.printStackTrace(); } if(!succ && request != null){ - request.getSession().setAttribute("message", "帐号" + username + "单点登录失败."); + request.getSession().setAttribute("message", message); throw new DisabledException("user is disabled"); } } Index: ssts-client-misc/src/main/java/org/tempuri/GetUserListResponseGetUserListResult.java =================================================================== diff -u --- ssts-client-misc/src/main/java/org/tempuri/GetUserListResponseGetUserListResult.java (revision 0) +++ ssts-client-misc/src/main/java/org/tempuri/GetUserListResponseGetUserListResult.java (revision 20233) @@ -0,0 +1,121 @@ +/** + * GetUserListResponseGetUserListResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.tempuri; + +public class GetUserListResponseGetUserListResult implements java.io.Serializable, org.apache.axis.encoding.AnyContentType, org.apache.axis.encoding.MixedContentType { + private org.apache.axis.message.MessageElement [] _any; + + public GetUserListResponseGetUserListResult() { + } + + public GetUserListResponseGetUserListResult( + org.apache.axis.message.MessageElement [] _any) { + this._any = _any; + } + + + /** + * Gets the _any value for this GetUserListResponseGetUserListResult. + * + * @return _any + */ + public org.apache.axis.message.MessageElement [] get_any() { + return _any; + } + + + /** + * Sets the _any value for this GetUserListResponseGetUserListResult. + * + * @param _any + */ + public void set_any(org.apache.axis.message.MessageElement [] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof GetUserListResponseGetUserListResult)) return false; + GetUserListResponseGetUserListResult other = (GetUserListResponseGetUserListResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any==null && other.get_any()==null) || + (this._any!=null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i=0; + i>GetUserListResponse>GetUserListResult")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +}