第三方免登录授权链接
parent
239e02e35c
commit
97f089761d
@ -0,0 +1,53 @@
|
|||||||
|
package com.manage.controller;
|
||||||
|
|
||||||
|
import org.apache.cxf.Bus;
|
||||||
|
import org.apache.cxf.bus.CXFBusFactory;
|
||||||
|
import org.apache.cxf.endpoint.EndpointImplFactory;
|
||||||
|
import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
|
||||||
|
import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName:
|
||||||
|
* @Description:
|
||||||
|
* @Param 传输参数
|
||||||
|
* @Return
|
||||||
|
* @Author: 曾文和
|
||||||
|
* @CreateDate: 2019/9/11 16:15
|
||||||
|
* @UpdateUser: 曾文和
|
||||||
|
* @UpdateDate: 2019/9/11 16:15
|
||||||
|
* @UpdateRemark: 更新说明
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class JAXDynamicClientFactory extends DynamicClientFactory {
|
||||||
|
protected JAXDynamicClientFactory(Bus bus) {
|
||||||
|
super(bus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EndpointImplFactory getEndpointImplFactory() {
|
||||||
|
return JaxWsEndpointImplFactory.getSingleton();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean allowWrapperOps() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static JAXDynamicClientFactory newInstance() {
|
||||||
|
Bus bus = CXFBusFactory.getThreadDefaultBus();
|
||||||
|
return new JAXDynamicClientFactory(bus);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean compileJavaSrc(String classPath, List srcList, String dest) {
|
||||||
|
org.apache.cxf.common.util.Compiler javaCompiler
|
||||||
|
= new org.apache.cxf.common.util.Compiler();
|
||||||
|
javaCompiler.setEncoding("UTF-8");
|
||||||
|
javaCompiler.setClassPath(classPath);
|
||||||
|
javaCompiler.setOutputDir(dest);
|
||||||
|
javaCompiler.setTarget("1.8");
|
||||||
|
return javaCompiler.compileFiles(srcList);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.manage.vo;
|
||||||
|
|
||||||
|
import org.simpleframework.xml.Element;
|
||||||
|
import org.simpleframework.xml.Root;
|
||||||
|
|
||||||
|
@Root(name = "Request")
|
||||||
|
public class AuthUserVO {
|
||||||
|
private String SourceSystem;
|
||||||
|
|
||||||
|
@Element(required = false)
|
||||||
|
private String TargetSystem;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
public String getSourceSystem() {
|
||||||
|
return SourceSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSourceSystem(String sourceSystem) {
|
||||||
|
SourceSystem = sourceSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTargetSystem() {
|
||||||
|
return TargetSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTargetSystem(String targetSystem) {
|
||||||
|
TargetSystem = targetSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AuthUserVO{" +
|
||||||
|
"SourceSystem='" + SourceSystem + '\'' +
|
||||||
|
", TargetSystem='" + TargetSystem + '\'' +
|
||||||
|
", username='" + username + '\'' +
|
||||||
|
", password='" + password + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.manage.util;
|
||||||
|
|
||||||
|
|
||||||
|
import org.simpleframework.xml.Serializer;
|
||||||
|
import org.simpleframework.xml.core.Persister;
|
||||||
|
|
||||||
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
|
public class XmlUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转xml
|
||||||
|
*/
|
||||||
|
public static <T> T xmlToEntity(Class<T> clazz, String str) {
|
||||||
|
try {
|
||||||
|
Serializer serializer = new Persister();
|
||||||
|
T entity = serializer.read(clazz, str);
|
||||||
|
return entity;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue