summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/interface-java-jaxws
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 04:43:15 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 04:43:15 +0000
commit175eef1031996bf177675620242a5a0ce865766c (patch)
tree1503665852bc8ca39a0a1c24c1c490d6597fb06e /branches/sca-java-1.x/modules/interface-java-jaxws
parent50a856b26b629cbbfb0b18c9f8f8c8418209d19c (diff)
Fix the J2W generation issue which misses the target namespace
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755474 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/interface-java-jaxws')
-rw-r--r--branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java9
-rw-r--r--branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WebServiceInterfaceProcessor.java49
2 files changed, 56 insertions, 2 deletions
diff --git a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
index d1b36fa17c..ac086745c0 100644
--- a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
@@ -53,6 +53,7 @@ import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
+import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
import org.apache.tuscany.sca.interfacedef.util.XMLType;
@@ -271,10 +272,12 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
name = getValue(name, "arg" + i);
QName element = new QName(ns, name);
Object logical = operation.getInputType().getLogical().get(i).getLogical();
+ QName type = null;
if (logical instanceof XMLType) {
((XMLType)logical).setElementName(element);
+ type = ((XMLType)logical).getTypeName();
}
- inputElements.add(new ElementInfo(element, null));
+ inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null)));
}
List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
@@ -288,10 +291,12 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
if (operation.getOutputType() != null) {
Object logical = operation.getOutputType().getLogical();
+ QName type = null;
if (logical instanceof XMLType) {
((XMLType)logical).setElementName(element);
+ type = ((XMLType)logical).getTypeName();
}
- outputElements.add(new ElementInfo(element, null));
+ outputElements.add(new ElementInfo(element, new TypeInfo(type, false, null)));
}
String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;
diff --git a/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WebServiceInterfaceProcessor.java b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WebServiceInterfaceProcessor.java
new file mode 100644
index 0000000000..18eda13efb
--- /dev/null
+++ b/branches/sca-java-1.x/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WebServiceInterfaceProcessor.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.java.jaxws;
+
+import javax.jws.WebService;
+
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
+
+/**
+ * Introspect the java class/interface to see if it has @WebService annotation
+ *
+ * @version $Rev$ $Date$
+ */
+public class WebServiceInterfaceProcessor implements JavaInterfaceVisitor {
+
+ public WebServiceInterfaceProcessor() {
+ super();
+ }
+
+ public void visitInterface(JavaInterface contract) throws InvalidInterfaceException {
+
+ final Class<?> clazz = contract.getJavaClass();
+ WebService webService = clazz.getAnnotation(WebService.class);
+ if (webService != null) {
+ // Mark SEI as Remotable
+ contract.setRemotable(true);
+ }
+ }
+
+}