Skip to content

Commit 83c7957

Browse files
committed
ContentType Support added
1 parent 9d26765 commit 83c7957

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

modules/virtualan-plugin/src/main/java/io/virtualan/core/soap/SoapEndpointCodeGenerator.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import javassist.ClassPool;
1818
import javassist.CtClass;
1919
import javassist.CtMethod;
20+
import javassist.LoaderClassPath;
2021
import javassist.bytecode.AnnotationsAttribute;
2122
import javassist.bytecode.ClassFile;
2223
import javassist.bytecode.ConstPool;
@@ -55,6 +56,8 @@ public class SoapEndpointCodeGenerator {
5556
public static Class buildEndpointClass(Map<String, SoapService> soapWsServices)
5657
throws Exception {
5758
ClassPool pool = ClassPool.getDefault();
59+
ClassLoader cl = Thread.currentThread().getContextClassLoader();
60+
pool.insertClassPath(new LoaderClassPath(cl));
5861
CtClass cc = pool.makeClass("io.virtualan.VirtualanEndpoint");
5962
addClassAnnotation(cc);
6063
for (Entry<String, SoapService> soapWsServiceEntry : soapWsServices.entrySet()) {
@@ -65,11 +68,10 @@ public static Class buildEndpointClass(Map<String, SoapService> soapWsServices)
6568
addParameterAnnotation(cc, method);
6669
addMethodAnnotation(cc, soapService, method);
6770
}
68-
// log.info("##########################");
69-
// cc.getClassFile()
70-
// .write(new DataOutputStream(System.out));
71-
// log.info("##########################");
72-
//
71+
if(log.isDebugEnabled()) {
72+
cc.getClassFile()
73+
.write(new DataOutputStream(new FileOutputStream("VirtualanEndpoint.java")));
74+
}
7375
return cc.toClass();
7476
}
7577

modules/virtualan-plugin/src/main/java/io/virtualan/core/soap/WSEndpointConfiguration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ public void setBeanFactory(BeanFactory beanFactory) {
4848
this.beanFactory = beanFactory;
4949
}
5050

51-
5251
@PostConstruct
5352
public void loadSoapWSservice() throws Exception {
5453
DefaultListableBeanFactory beanRegistry = (DefaultListableBeanFactory) beanFactory;
55-
5654
Arrays.stream(soapPackage.split(";")).forEach( packageName -> {
5755
List<Class> portTypeList = soapEndpointCodeGenerator.findMyTypes(packageName);
5856
for(Class clazz : portTypeList) {

samples/virtualan-wsdl-soap/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<version>1.0.0-SNAPSHOT</version>
1010
<modelVersion>4.0.0</modelVersion>
1111
<properties>
12+
<virtualan.version>2.0.2-SNAPSHOT</virtualan.version>
1213
<cucumber.version>1.2.5</cucumber.version>
1314
<java.version>1.8</java.version>
1415
<maven-jaxb2-plugin.version>0.14.0</maven-jaxb2-plugin.version>
@@ -148,7 +149,7 @@
148149
</exclusion>
149150
</exclusions>
150151
<groupId>io.virtualan</groupId>
151-
<version>2.0.2-SNAPSHOT</version>
152+
<version>${virtualan.version}</version>
152153
</dependency>
153154
<dependency>
154155
<artifactId>spring-context</artifactId>

0 commit comments

Comments
 (0)