summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/interface-java-jaxws/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 06:47:40 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 06:47:40 +0000
commit8d7cb21ef3c6cf4a39ee77e3358d2eeb129864fe (patch)
tree6bb016d2eaa7d5254232ffcb735872e94ab8c14c /java/sca/modules/interface-java-jaxws/src
parent02f18503f2e2707b6ed535929bcd412877512419 (diff)
Fix for TUSCANY-2444
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/interface-java-jaxws/src')
-rw-r--r--java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java15
-rw-r--r--java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java2
-rw-r--r--java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java4
-rw-r--r--java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java4
4 files changed, 20 insertions, 5 deletions
diff --git a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
index a23036db7c..b05715b54e 100644
--- a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
+++ b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
@@ -261,5 +261,20 @@ public class CodeGenerationHelper {
return Opcodes.ARETURN;
}
+
+ /**
+ * Get the package prefix for generated JAXWS artifacts
+ * @param cls
+ * @return
+ */
+ public static String getPackagePrefix(Class<?> cls) {
+ String name = cls.getName();
+ int index = name.lastIndexOf('.');
+ if (index == -1) {
+ return "jaxws.";
+ } else {
+ return name.substring(0, index) + ".jaxws.";
+ }
+ }
}
diff --git a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
index fa32060447..a4f2facb4b 100644
--- a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
+++ b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
@@ -293,7 +293,7 @@ public class JAXWSFaultExceptionMapper implements FaultExceptionMapper {
}
if (faultBean == null) {
- final String faultBeanClassName = cls.getPackage().getName() + ".jaxws." + cls.getSimpleName() + "Bean";
+ final String faultBeanClassName = CodeGenerationHelper.getPackagePrefix(cls) + cls.getSimpleName() + "Bean";
final QName qname = faultName;
faultType = AccessController.doPrivileged(new PrivilegedAction<DataType<XMLType>>() {
public DataType<XMLType> run() {
diff --git a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
index 758dcb5dd7..1e1a0c4e94 100644
--- a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
@@ -188,7 +188,7 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
requestWrapper == null ? operationName : getValue(requestWrapper.localName(), operationName);
String wrapperBeanName = requestWrapper == null ? "" : requestWrapper.className();
if ("".equals(wrapperBeanName)) {
- wrapperBeanName = clazz.getPackage().getName() + ".jaxws." + capitalize(method.getName());
+ wrapperBeanName = CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName());
}
DataType<XMLType> inputWrapperDT = null;
@@ -222,7 +222,7 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
wrapperBeanName = responseWrapper == null ? "" : responseWrapper.className();
if ("".equals(wrapperBeanName)) {
wrapperBeanName =
- clazz.getPackage().getName() + ".jaxws." + capitalize(method.getName()) + "Response";
+ CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName()) + "Response";
}
DataType<XMLType> outputWrapperDT = null;
diff --git a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
index 785496f7b6..764c10ff00 100644
--- a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
+++ b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
@@ -50,7 +50,7 @@ public class WrapperBeanGenerator extends BaseBeanGenerator {
String wrapperNamespace = JavaInterfaceUtil.getNamespace(sei);
String wrapperName = m.getName();
String wrapperBeanName = capitalize(wrapperName);
- String wrapperClassName = sei.getPackage().getName() + ".jaxws." + wrapperBeanName;
+ String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName;
return generateRequestWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl);
}
@@ -111,7 +111,7 @@ public class WrapperBeanGenerator extends BaseBeanGenerator {
String wrapperName = m.getName() + "Response";
String wrapperBeanName = capitalize(wrapperName);
- String wrapperClassName = sei.getPackage().getName() + ".jaxws." + wrapperBeanName;
+ String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName;
return generateResponseWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl);
}