diff options
Diffstat (limited to 'sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef')
4 files changed, 109 insertions, 3 deletions
diff --git a/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java new file mode 100644 index 0000000000..71a860d152 --- /dev/null +++ b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java @@ -0,0 +1,28 @@ +/*
+ * 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;
+
+/**
+ * Bean Interface
+ */
+public interface BeanInterface {
+ String getAttr();
+ void setAttr(String attr);
+}
diff --git a/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java new file mode 100644 index 0000000000..684f7b4c01 --- /dev/null +++ b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java @@ -0,0 +1,35 @@ +/*
+ * 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;
+
+/**
+ * Impl of BeanInterface
+ */
+public class BeanInterfaceImpl implements BeanInterface {
+ private String attr;
+
+ public String getAttr() {
+ return attr;
+ }
+
+ public void setAttr(String attr) {
+ this.attr = attr;
+ }
+}
diff --git a/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java new file mode 100644 index 0000000000..c1314d788c --- /dev/null +++ b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java @@ -0,0 +1,39 @@ +/*
+ * 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.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * Test XML Adapter
+ */
+public class TestAdapter extends XmlAdapter<BeanInterfaceImpl, BeanInterface> {
+
+ @Override
+ public BeanInterfaceImpl marshal(BeanInterface v) throws Exception {
+ return (BeanInterfaceImpl)v;
+ }
+
+ @Override
+ public BeanInterface unmarshal(BeanInterfaceImpl v) throws Exception {
+ return v;
+ }
+
+}
diff --git a/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java index a6a3375eff..5c20892d91 100644 --- a/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java +++ b/sca-java-1.x/trunk/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java @@ -27,6 +27,7 @@ import java.util.Map; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.ws.Holder; import org.osoa.sca.annotations.Remotable; @@ -60,7 +61,10 @@ public interface TestInterface { @WebMethod @WebResult(name = "output") - String webMethod(@WebParam(name = "input", mode = WebParam.Mode.IN) - String in, @WebParam(name = "holder", mode = WebParam.Mode.INOUT) - Holder<String> holder); + String webMethod(@WebParam(name = "input", mode = WebParam.Mode.IN) String in, + @WebParam(name = "holder", mode = WebParam.Mode.INOUT) Holder<String> holder); + + @XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class) + BeanInterface beanMethod(@XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class) BeanInterface in, + String str); } |