summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java29
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java32
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java38
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java33
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl127
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite37
-rw-r--r--branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java67
-rw-r--r--branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java45
-rw-r--r--branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java3
-rw-r--r--branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java18
-rw-r--r--branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java11
-rw-r--r--branches/sca-java-1.3.2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java7
-rw-r--r--branches/sca-java-1.3.2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java3
13 files changed, 428 insertions, 22 deletions
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java
new file mode 100644
index 0000000000..7f9b62f9b4
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java
@@ -0,0 +1,29 @@
+/*
+ * 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.itest.databindings.jaxb;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for AClientService.
+ */
+@Remotable
+public interface AClientService {
+ public String getGreetingsForward(String name);
+}
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java
new file mode 100644
index 0000000000..1762812c1f
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java
@@ -0,0 +1,32 @@
+/*
+ * 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.itest.databindings.jaxb;
+
+import javax.jws.soap.SOAPBinding;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for AService.
+ */
+@Remotable
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface AService {
+ public String getGreetings(String name);
+}
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java
new file mode 100644
index 0000000000..8b484e93f0
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.itest.databindings.jaxb.impl;
+
+import org.apache.tuscany.sca.itest.databindings.jaxb.AClientService;
+import org.apache.tuscany.sca.itest.databindings.jaxb.AService;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements AService.
+ */
+@Service(AClientService.class)
+public class AClientServiceImpl implements AClientService {
+
+ @Reference
+ protected AService aService;
+
+ public String getGreetingsForward(String name) {
+ return aService.getGreetings(name);
+ }
+}
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java
new file mode 100644
index 0000000000..4a35d41c04
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java
@@ -0,0 +1,33 @@
+/*
+ * 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.itest.databindings.jaxb.impl;
+
+import org.apache.tuscany.sca.itest.databindings.jaxb.AService;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements AService.
+ */
+@Service(AService.class)
+public class AServiceImpl implements AService {
+
+ public String getGreetings(String name) {
+ return "Hello " + name;
+ }
+}
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl
new file mode 100644
index 0000000000..4a37094fa3
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://jaxb.databindings.itest.sca.tuscany.apache.org"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:ns0="http://jaxb.databindings.itest.sca.tuscany.apache.org"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:ns1="http://org.apache.axis2/xsd"
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://jaxb.databindings.itest.sca.tuscany.apache.org" xmlns:ns="http://jaxb.databindings.itest.sca.tuscany.apache.org">
+ <xs:element name="getGreetings" nillable="true" type="xs:string"/>
+ <xs:element name="getGreetingsResponse" nillable="true" type="xs:string"/>
+ </xs:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part name="parameters" element="ns0:getGreetings"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part name="parameters" element="ns0:getGreetingsResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="AServicePortType">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="ns0:getGreetingsRequest" wsaw:Action="urn:getGreetings"/>
+ <wsdl:output message="ns0:getGreetingsResponse" wsaw:Action="urn:getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="AServiceSOAP12Binding" type="ns0:AServicePortType">
+ <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <soap12:operation soapAction="urn:getGreetings" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:binding name="AServicePortTypeBinding" type="ns0:AServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:binding name="AServiceHttpBinding" type="ns0:AServicePortType">
+ <http:binding verb="POST"/>
+ <wsdl:operation name="getGreetings">
+ <http:operation location="AService/getGreetings"/>
+ <wsdl:input>
+ <mime:content part="getGreetings" type="text/xml"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="getGreetings" type="text/xml"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:binding name="AServiceSOAP11Binding" type="ns0:AServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <soap:operation soapAction="urn:getGreetings" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="AServicePortTypeService">
+ <wsdl:port name="AServicePortTypePort" binding="ns0:AServicePortTypeBinding">
+ <soap:address location="http://localhost:8080/AService"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <wsdl:service name="AService">
+ <wsdl:port name="AServiceHttpport" binding="ns0:AServiceHttpBinding">
+ <http:address location="http://localhost:8080/AService/httpport"/>
+ </wsdl:port>
+ <wsdl:port name="AServiceSOAP12port_http" binding="ns0:AServiceSOAP12Binding">
+ <soap12:address location="http://localhost:8080/AService/soap12port"/>
+ </wsdl:port>
+ <wsdl:port name="AServiceSOAP11port_http" binding="ns0:AServiceSOAP11Binding">
+ <soap:address location="http://localhost:8080/AService/soap11port"/>
+ </wsdl:port>
+ <wsdl:port name="AServiceSOAP12port_http_null" binding="ns0:AServiceSOAP12Binding">
+ <soap12:address location=""/>
+ </wsdl:port>
+ <wsdl:port name="AServiceSOAP12port_http_wsdl" binding="ns0:AServiceSOAP12Binding">
+ <soap12:address location="inWsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite
new file mode 100644
index 0000000000..5a7873d07a
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://itest" name="doclitbarewsdltest">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.databindings.jaxb.impl.AServiceImpl"/>
+ <service name="AService">
+ <interface.wsdl interface="http://jaxb.databindings.itest.sca.tuscany.apache.org#wsdl.interface(AServicePortType)"/>
+ <binding.ws uri="http://localhost:8085/AService/endpointref"/>
+ </service>
+ </component>
+ <component name="AClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.databindings.jaxb.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <!--interface.wsdl interface="http://jaxb.databindings.itest.sca.tuscany.apache.org#wsdl.interface(AServicePortType)"/-->
+ <interface.java interface="org.apache.tuscany.sca.itest.databindings.jaxb.AService"/>
+ <binding.ws uri="http://localhost:8085/AService/endpointref"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java
new file mode 100644
index 0000000000..744bf20494
--- /dev/null
+++ b/branches/sca-java-1.3.2/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java
@@ -0,0 +1,67 @@
+/*
+ * 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.itest.databindings.jaxb;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DocLitBareWsdlTestCase {
+
+ private static SCADomain domain;
+
+ /**
+ * Runs once before running the tests
+ */
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ domain = SCADomain.newInstance("doclitbarewsdl.composite");
+ } catch (Throwable e) {
+ // @Ignore("TUSCANY-2398")
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Runs once after running the tests
+ */
+ @AfterClass
+ public static void tearDown() {
+ if (domain != null) {
+ domain.close();
+ }
+ }
+
+ // @Ignore("TUSCANY-2398")
+ @Test
+ public void testDocLitBareWsdl() throws Exception {
+ AClientService client = domain.getService(AClientService.class, "AClientComponent");
+ String name = "Pandu";
+ String resp = client.getGreetingsForward(name);
+ Assert.assertEquals("Hello " + name, resp);
+ }
+}
diff --git a/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
index be87ec611b..1047331924 100644
--- a/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
+++ b/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
@@ -236,6 +236,10 @@ public class Interface2WSDLGenerator {
javax.wsdl.Operation operation = generateOperation(definition, op, helpers, wrappers);
portType.addOperation(operation);
String action = ((JavaOperation)op).getAction();
+ if ((action == null || "".equals(action)) && !op.isWrapperStyle() && op.getWrapper() == null) {
+ // Bare style
+ action = "urn:" + op.getName();
+ }
BindingOperation bindingOp = definitionGenerator.createBindingOperation(definition, operation, action);
binding.addBindingOperation(bindingOp);
}
@@ -307,7 +311,25 @@ public class Interface2WSDLGenerator {
if (entry.getValue().size() == 1 && entry.getValue().get(0).getQName() == null) {
// special case for global fault element
QName typeName = entry.getValue().get(0).getType().getQName();
- wrapper.setAttribute("type", typeName.getLocalPart());
+ String nsURI = typeName.getNamespaceURI();
+ if ("".equals(nsURI)) {
+ wrapper.setAttribute("type", typeName.getLocalPart());
+ addSchemaImport(schema, "", schemaDoc);
+ } else if (targetNS.equals(nsURI)) {
+ wrapper.setAttribute("type", typeName.getLocalPart());
+ } else if (SCHEMA_NS.equals(nsURI)) {
+ wrapper.setAttribute("type", "xs:" + typeName.getLocalPart());
+ } else {
+ Map<String, String> prefixMap = prefixMaps.get(schema);
+ String prefix = prefixMap.get(nsURI);
+ if (prefix == null) {
+ prefix = "ns" + i++;
+ prefixMap.put(nsURI, prefix);
+ schema.setAttributeNS(XMLNS_NS, "xmlns:" + prefix, nsURI);
+ addSchemaImport(schema, nsURI, schemaDoc);
+ }
+ wrapper.setAttribute("type", prefix + ":" + typeName.getLocalPart());
+ }
} else {
// normal wrapper containing type definition inline
Element complexType = schemaDoc.createElementNS(SCHEMA_NS, "xs:complexType");
@@ -496,6 +518,7 @@ public class Interface2WSDLGenerator {
inputMsg.setUndefined(false);
definition.addMessage(inputMsg);
+ List<ElementInfo> elements = null;
// FIXME: By default, java interface is mapped to doc-lit-wrapper style WSDL
if (op.getWrapper() != null) {
// Generate doc-lit-wrapper style
@@ -505,6 +528,11 @@ public class Interface2WSDLGenerator {
int i = 0;
for (DataType d : op.getInputType().getLogical()) {
inputMsg.addPart(generatePart(definition, d, "arg" + i));
+ elements = new ArrayList<ElementInfo>();
+ ElementInfo element = getElementInfo(d.getPhysical(), d, null, helpers);
+ elements.add(element);
+ QName elementName = ((XMLType)d.getLogical()).getElementName();
+ wrappers.put(elementName, elements);
i++;
}
}
@@ -522,7 +550,15 @@ public class Interface2WSDLGenerator {
if (op.getWrapper() != null) {
outputMsg.addPart(generateWrapperPart(definition, op, helpers, wrappers, false));
} else {
- outputMsg.addPart(generatePart(definition, op.getOutputType(), "return"));
+ DataType outputType = op.getOutputType();
+ outputMsg.addPart(generatePart(definition, outputType, "return"));
+ if (outputType != null) {
+ elements = new ArrayList<ElementInfo>();
+ ElementInfo element = getElementInfo(outputType.getPhysical(), outputType, null, helpers);
+ elements.add(element);
+ QName elementName = ((XMLType)outputType.getLogical()).getElementName();
+ wrappers.put(elementName, elements);
+ }
}
output.setMessage(outputMsg);
@@ -546,17 +582,16 @@ public class Interface2WSDLGenerator {
}
fault.setMessage(faultMsg);
operation.addFault(fault);
- List<ElementInfo> elements = null;
if (faultType.getLogical().getPhysical() != faultType.getPhysical()) {
// create special wrapper for type indirection to real fault bean
- elements = new ArrayList<ElementInfo>(1);
DataType logical = faultType.getLogical();
+ elements = new ArrayList<ElementInfo>();
elements.add(getElementInfo(logical.getPhysical(), logical, null, helpers));
} else {
// convert synthesized fault bean to a wrapper type
- elements = new ArrayList<ElementInfo>();
for (DataType<XMLType> propDT: op.getFaultBeans().get(faultName)) {
XMLType logical = propDT.getLogical();
+ elements = new ArrayList<ElementInfo>();
elements.add(getElementInfo(propDT.getPhysical(), propDT, logical.getElementName(), helpers));
}
}
diff --git a/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java b/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
index f99947a52e..d0b79f9b0e 100644
--- a/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
+++ b/branches/sca-java-1.3.2/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
@@ -146,7 +146,8 @@ public class WSDLDefinitionGenerator {
try {
for (Iterator oi = portType.getOperations().iterator(); oi.hasNext();) {
Operation operation = (Operation)oi.next();
- BindingOperation bindingOperation = createBindingOperation(definition, operation, "");
+ BindingOperation bindingOperation =
+ createBindingOperation(definition, operation, "urn:" + operation.getName());
binding.addBindingOperation(bindingOperation);
}
} catch (WSDLException e) {
diff --git a/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java b/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
index 71694c0a0a..fb5f939edb 100644
--- a/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
+++ b/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
@@ -133,7 +133,8 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
// Check if the source operation is wrapped
DataType<List<DataType>> sourceType = context.getSourceDataType();
Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle();
+ boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
+ boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
// Find the wrapper handler for source data
WrapperHandler sourceWrapperHandler = null;
@@ -143,19 +144,20 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
// Check if the target operation is wrapped
DataType<List<DataType>> targetType = context.getTargetDataType();
Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle();
+ boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
+ boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
// Find the wrapper handler for target data
WrapperHandler targetWrapperHandler = null;
String targetDataBinding = getDataBinding(targetOp);
targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
- if ((!sourceWrapped) && targetWrapped) {
+ if ((!sourceWrapped && !sourceBare) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
- ElementInfo wrapperElement = wrapper.getInputWrapperElement();
+ // ElementInfo wrapperElement = wrapper.getInputWrapperElement();
- Class<?> targetWrapperClass = wrapper != null ? wrapper.getInputWrapperClass() : null;
+ // Class<?> targetWrapperClass = wrapper != null ? wrapper.getInputWrapperClass() : null;
if (source == null) {
// Empty child elements
@@ -207,14 +209,14 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
true);
return new Object[] {targetWrapper};
- } else if (sourceWrapped && (!targetWrapped)) {
+ } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
// Wrapped to Unwrapped
Object sourceWrapper = source[0];
Object[] target = null;
- List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
+ // List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
if (targetWrapperHandler != null) {
- ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
+ // ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
// FIXME: This is a workaround for the wsdless support as it passes in child elements
// under the wrapper that only matches by position
if (sourceWrapperHandler.isInstance(sourceWrapper, sourceOp, true)) {
diff --git a/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java b/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
index 71253f00b4..8d586905c4 100644
--- a/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
+++ b/branches/sca-java-1.3.2/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
@@ -154,7 +154,8 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
try {
DataType<DataType> sourceType = context.getSourceDataType();
Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle();
+ boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
+ boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
WrapperHandler sourceWrapperHandler = null;
String sourceDataBinding = getDataBinding(sourceOp);
@@ -162,12 +163,14 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
DataType<DataType> targetType = context.getTargetDataType();
Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle();
+ boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
+ boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
+
WrapperHandler targetWrapperHandler = null;
String targetDataBinding = getDataBinding(targetOp);
targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
- if ((!sourceWrapped) && targetWrapped) {
+ if ((!sourceWrapped &&!sourceBare) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
ElementInfo wrapperElement = wrapper.getOutputWrapperElement();
@@ -211,7 +214,7 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
targetWrapperHandler.setChildren(targetWrapper, new Object[] {child}, targetOp, false);
return targetWrapper;
- } else if (sourceWrapped && (!targetWrapped)) {
+ } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
// Wrapped to Unwrapped
Object sourceWrapper = response;
List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
diff --git a/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
index f779e04258..d1b36fa17c 100644
--- a/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ b/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
@@ -125,8 +125,11 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
boolean bare = false;
if (methodSOAPBinding != null) {
bare = methodSOAPBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE;
- // For BARE parameter style, the data is in the wrapped format already
- operation.setWrapperStyle(bare);
+ if(bare) {
+ // For BARE parameter style, the data won't be unwrapped
+ // The wrapper should be null
+ operation.setWrapperStyle(false);
+ }
documentStyle = methodSOAPBinding.style() == Style.DOCUMENT;
}
diff --git a/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java b/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
index cdfac400e2..108d283584 100644
--- a/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
+++ b/branches/sca-java-1.3.2/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
@@ -36,7 +36,6 @@ import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import com.example.stock.StockExceptionTest;
-
/**
*
* @version $Rev$ $Date$
@@ -91,7 +90,7 @@ public class JAXWSJavaInterfaceProcessorTestCase extends TestCase {
op = op2;
}
- assertTrue(op.isWrapperStyle());
+ assertTrue(!op.isWrapperStyle() && op.getWrapper() == null);
if ("M2".equals(op2.getName())) {
op = op2;