Author: barrettj
Date: Tue Oct  5 15:11:30 2010
New Revision: 1004667

URL: http://svn.apache.org/viewvc?rev=1004667&view=rev
Log:
Add support for Doc/Lit/Bare operations with no arguments.  These flow as 
messages with empty soap:Body elements.  Also add associated unit and 
integration tests.

Added:
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/doclitbarenoarg.wsdl
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareNoArgTests.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/DocLitBareNoArgPortTypeImpl.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/BareDocLitNoArgService.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/DocLitBareNoArgPortType.java
Modified:
    axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
    
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
    
axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java

Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml Tue Oct  5 
15:11:30 2010
@@ -967,6 +967,19 @@
                                 <zip 
destfile="${servicejars.dir}/BareDocLitService.jar" 
basedir="${servicejars.dir}/BareDocLitService" />
                                 <delete 
dir="${servicejars.dir}/BareDocLitService" />
 
+                                <copy 
toDir="${servicejars.dir}/BareDocLitNoArgService/">
+                                    <fileset dir="target/test-classes">
+                                        <include 
name="org/apache/axis2/jaxws/sample/doclitbarenoarg/**" />
+                                    </fileset>
+                                    <fileset 
dir="test/org/apache/axis2/jaxws/sample/doclitbarenoarg">
+                                        <include name="META-INF/**" />
+                                    </fileset>
+                                </copy>
+
+                                <zip 
destfile="${servicejars.dir}/BareDocLitNoArgService.jar"
+                                     
basedir="${servicejars.dir}/BareDocLitNoArgService" />
+                                <delete 
dir="${servicejars.dir}/BareDocLitNoArgService" />
+
                                 <copy 
toDir="${servicejars.dir}/EchoMessageService/">
                                     <fileset dir="target/test-classes">
                                         <include 
name="org/apache/axis2/jaxws/nonanonymous/complextype/**" />
@@ -1258,6 +1271,7 @@
                         <include>**/MTOMFeatureTests.java</include>
                         <include>**/JAXBProviderTests.java</include>
                         <include>**/BareTests.java</include>
+                        <include>**/BareNoArgTests.java</include>
                         <include>**/AddNumbersHandlerTests.java</include>
                         <include>**/HeadersHandlerTests.java</include>
                         <include>**/AddNumbersTests.java</include>

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/doclitbarenoarg.wsdl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/doclitbarenoarg.wsdl?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/doclitbarenoarg.wsdl
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/doclitbarenoarg.wsdl
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,68 @@
+<?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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
+    xmlns:tns="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="DoclitBareNoArg"
+    targetNamespace="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";>
+    
+    <wsdl:types>
+        <xsd:schema
+            
targetNamespace="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+            
xmlns:tns="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+            <xsd:element name="String" type="xsd:string" />
+        </xsd:schema>
+    </wsdl:types>
+
+    <wsdl:message name="NoParam" />
+
+    <wsdl:message name="echoStringOut">
+        <wsdl:part name="echoStringOut" element="tns:String" />
+    </wsdl:message>
+
+    <wsdl:portType name="DocLitBareNoArgPortType">
+        <wsdl:operation name="twoWayEmpty">
+            <wsdl:input message="tns:NoParam" />
+            <wsdl:output message="tns:echoStringOut" />
+        </wsdl:operation>
+    </wsdl:portType>
+    
+    <wsdl:binding name="DocLitBareNoArg" type="tns:DocLitBareNoArgPortType">
+        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
+        <wsdl:operation name="twoWayEmpty">
+            <wsdl:input>
+                <soap:body use="literal"  />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"  />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    
+    <wsdl:service name="BareDocLitNoArgService">
+        <wsdl:port binding="tns:DocLitBareNoArg" name="BareDocLitNoArgPort">
+            <soap:address 
location="http://localhost:6060/axis2/services/BareDocLitNoArgService"; />
+        </wsdl:port>
+    </wsdl:service>
+    
+</wsdl:definitions>
\ No newline at end of file

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareNoArgTests.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareNoArgTests.java?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareNoArgTests.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/BareNoArgTests.java
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,64 @@
+/*
+ * 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.axis2.jaxws.sample;
+
+import org.apache.axis2.jaxws.framework.AbstractTestCase;
+import 
org.apache.axis2.jaxws.sample.doclitbarenoarg.sei.BareDocLitNoArgService;
+import 
org.apache.axis2.jaxws.sample.doclitbarenoarg.sei.DocLitBareNoArgPortType;
+
+import javax.xml.ws.BindingProvider;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class BareNoArgTests extends AbstractTestCase {
+
+    static final String ENDPOINT_URL = 
+        
"http://localhost:6060/axis2/services/BareDocLitNoArgService.DocLitBareNoArgPortTypeImplPort";;
+
+    public static Test suite() {
+        return getTestSetup(new TestSuite(BareNoArgTests.class));
+    }
+    
+    public void testTwoWayEmpty_With_SOAPACTION() {
+        BareDocLitNoArgService service = new BareDocLitNoArgService();
+        DocLitBareNoArgPortType proxy = service.getBareDocLitNoArgPort();
+        BindingProvider p = (BindingProvider) proxy;
+
+        p.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, 
Boolean.TRUE);
+        p.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, 
"twoWayEmpty");
+        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
ENDPOINT_URL);
+        
+        String response = proxy.twoWayEmpty();
+        assertTrue("Did not receive expected response value", 
+                   
"org.apache.axis2.jaxws.sample.doclitbarenoarg.DocLitBareNoArgPortTypeImpl.twoWayEmpty".equals(response));
+    }
+
+    public void testTwoWayEmpty_No_SOAPACTION() {
+        BareDocLitNoArgService service = new BareDocLitNoArgService();
+        DocLitBareNoArgPortType proxy = service.getBareDocLitNoArgPort();
+        BindingProvider p = (BindingProvider) proxy;
+
+        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
ENDPOINT_URL);
+        
+        String response = proxy.twoWayEmpty();
+        assertTrue("Did not receive expected response value", 
+                   
"org.apache.axis2.jaxws.sample.doclitbarenoarg.DocLitBareNoArgPortTypeImpl.twoWayEmpty".equals(response));
+    }
+}

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/DocLitBareNoArgPortTypeImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/DocLitBareNoArgPortTypeImpl.java?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/DocLitBareNoArgPortTypeImpl.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/DocLitBareNoArgPortTypeImpl.java
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.axis2.jaxws.sample.doclitbarenoarg;
+
+import 
org.apache.axis2.jaxws.sample.doclitbarenoarg.sei.DocLitBareNoArgPortType;
+
+import javax.jws.WebService;
+
+...@webservice(serviceName="BareDocLitNoArgService", 
+            
endpointInterface="org.apache.axis2.jaxws.sample.doclitbarenoarg.sei.DocLitBareNoArgPortType")
+public class DocLitBareNoArgPortTypeImpl implements DocLitBareNoArgPortType {
+
+    /* (non-Javadoc)
+     * @see 
org.apache.axis2.jaxws.sample.doclitbarenoarg.sei.DocLitBareNoArgPortType#twoWayEmpty()
+     */
+    public String twoWayEmpty() {
+        return 
"org.apache.axis2.jaxws.sample.doclitbarenoarg.DocLitBareNoArgPortTypeImpl.twoWayEmpty";
+    }
+
+}

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,68 @@
+<?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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
+    xmlns:tns="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="DoclitBareNoArg"
+    targetNamespace="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";>
+    
+    <wsdl:types>
+        <xsd:schema
+            
targetNamespace="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+            
xmlns:tns="http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+            <xsd:element name="String" type="xsd:string" />
+        </xsd:schema>
+    </wsdl:types>
+
+    <wsdl:message name="NoParam" />
+
+    <wsdl:message name="echoStringOut">
+        <wsdl:part name="echoStringOut" element="tns:String" />
+    </wsdl:message>
+
+    <wsdl:portType name="DocLitBareNoArgPortType">
+        <wsdl:operation name="twoWayEmpty">
+            <wsdl:input message="tns:NoParam" />
+            <wsdl:output message="tns:echoStringOut" />
+        </wsdl:operation>
+    </wsdl:portType>
+    
+    <wsdl:binding name="DocLitBareNoArg" type="tns:DocLitBareNoArgPortType">
+        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
+        <wsdl:operation name="twoWayEmpty">
+            <wsdl:input>
+                <soap:body use="literal"  />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"  />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    
+    <wsdl:service name="BareDocLitNoArgService">
+        <wsdl:port binding="tns:DocLitBareNoArg" name="BareDocLitNoArgPort">
+            <soap:address 
location="http://localhost:6060/axis2/services/BareDocLitNoArgService"; />
+        </wsdl:port>
+    </wsdl:service>
+    
+</wsdl:definitions>
\ No newline at end of file

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/BareDocLitNoArgService.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/BareDocLitNoArgService.java?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/BareDocLitNoArgService.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/BareDocLitNoArgService.java
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+//
+// Generated By:JAX-WS RI IBM 2.1.1 in JDK 6 (JAXB RI IBM JAXB 2.1.3 in JDK 
1.6)
+//
+
+
+package org.apache.axis2.jaxws.sample.doclitbarenoarg.sei;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+...@webserviceclient(name = "BareDocLitNoArgService", targetNamespace = 
"http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";, wsdlLocation = 
"doclitbarenoarg.wsdl")
+public class BareDocLitNoArgService
+    extends Service
+{
+
+    private final static URL BAREDOCLITNOARGSERVICE_WSDL_LOCATION;
+    
+    private static String wsdlLocation = 
"/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl";
+    static {
+        URL url = null;
+        try {
+            String baseDir = new 
File(System.getProperty("basedir",".")).getCanonicalPath();
+            wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath();
+            File file = new File(wsdlLocation);
+            url = file.toURL();
+//            url = new 
URL("file:/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/META-INF/doclitbarenoarg.wsdl");
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        BAREDOCLITNOARGSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BareDocLitNoArgService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BareDocLitNoArgService() {
+        super(BAREDOCLITNOARGSERVICE_WSDL_LOCATION, new 
QName("http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";, 
"BareDocLitNoArgService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns DocLitBareNoArgPortType
+     */
+    @WebEndpoint(name = "BareDocLitNoArgPort")
+    public DocLitBareNoArgPortType getBareDocLitNoArgPort() {
+        return (DocLitBareNoArgPortType)super.getPort(new 
QName("http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";, 
"BareDocLitNoArgPort"), DocLitBareNoArgPortType.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {...@link javax.xml.ws.WebServiceFeature} to configure on 
the proxy.  Supported features not in the <code>features</code> parameter will 
have their default values.
+     * @return
+     *     returns DocLitBareNoArgPortType
+     */
+    @WebEndpoint(name = "BareDocLitNoArgPort")
+    public DocLitBareNoArgPortType getBareDocLitNoArgPort(WebServiceFeature... 
features) {
+        return (DocLitBareNoArgPortType)super.getPort(new 
QName("http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";, 
"BareDocLitNoArgPort"), DocLitBareNoArgPortType.class, features);
+    }
+
+}

Added: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/DocLitBareNoArgPortType.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/DocLitBareNoArgPortType.java?rev=1004667&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/DocLitBareNoArgPortType.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/doclitbarenoarg/sei/DocLitBareNoArgPortType.java
 Tue Oct  5 15:11:30 2010
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+//
+// Generated By:JAX-WS RI IBM 2.1.1 in JDK 6 (JAXB RI IBM JAXB 2.1.3 in JDK 
1.6)
+//
+
+
+package org.apache.axis2.jaxws.sample.doclitbarenoarg.sei;
+
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+...@webservice(name = "DocLitBareNoArgPortType", targetNamespace = 
"http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";)
+...@soapbinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface DocLitBareNoArgPortType {
+
+
+    /**
+     * 
+     * @return
+     *     returns java.lang.String
+     */
+    @WebMethod
+    @WebResult(name = "String", targetNamespace = 
"http://sei.doclitbarenoarg.sample.jaxws.axis2.apache.org";, partName = 
"echoStringOut")
+    public String twoWayEmpty();
+
+}

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
 Tue Oct  5 15:11:30 2010
@@ -1260,9 +1260,14 @@ public class WSDL11ToAxisServiceBuilder 
                                                           
wsdl4jMessage.getQName().getLocalPart());
                     }
                 } else {
-                    // this is allowed in the spec in this case element qname 
is null and nothing is send
-                    // in the soap body
+                    // This is allowed in the spec in this case element qname 
is null and nothing is send
+                    // in the soap body.  This is true for Doc/Lit/Bare 
operations that do not have any paramaters.
+                    // In this case, add a mapping of the operation to a null 
key so the empty body can be routed on
+                    // (for example in SOAPMessageBodyBasedDispatcher).
                     message.setElementQName(null);
+                    AxisOperation operation = message.getAxisOperation();
+                    AxisService service = operation.getAxisService();
+                    service.addMessageElementQNameToOperationMapping(null, 
operation);
                 }
             } else {
                 if (bindingPartsList.size() == 0) {

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedDispatcher.java
 Tue Oct  5 15:11:30 2010
@@ -52,7 +52,6 @@ public class SOAPMessageBodyBasedDispatc
             throws AxisFault {
 
         String localName = 
messageContext.getEnvelope().getSOAPBodyFirstElementLocalName();
-
         AxisOperation axisOperation = null;
         if (localName != null){
            OMNamespace ns = 
messageContext.getEnvelope().getSOAPBodyFirstElementNS();
@@ -68,6 +67,10 @@ public class SOAPMessageBodyBasedDispatc
                axisOperation = service.getOperation(operationName);
            }
 
+        } else {
+            // Doc/Lit/Bare no arg messages can have an empty body.
+            // See if any operations were registered with an empty body
+            axisOperation = service.getOperationByMessageElementQName(null);
         }
         return axisOperation;
     }

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
 Tue Oct  5 15:11:30 2010
@@ -40,7 +40,9 @@ public class SOAPMessageBodyBasedOperati
             throws AxisFault {
         String localPart = 
messageContext.getEnvelope().getSOAPBodyFirstElementLocalName();
         if (localPart == null) {
-            return null;
+            // Doc/Lit/Bare no arg; see if an operation is registered.
+            AxisOperation axisOperation = 
service.getOperationByMessageElementQName(null);
+            return axisOperation;
         }
         if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug(messageContext.getLogIDString() +

Modified: 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
 Tue Oct  5 15:11:30 2010
@@ -497,6 +497,13 @@ class OperationDescriptionImpl
                         break;
                     }
                 }
+            } else {
+                // There are no parameters for this Doc/Lit/Bare operation.  
That means the inbound soap:Body will
+                // be empty, so when asking the Body for the first element 
QName for routing purposes, a null will 
+                // be returned.  By mapping a null key to this operation here, 
it will be the one found for the null
+                // element during routing.
+                
getEndpointInterfaceDescriptionImpl().getEndpointDescriptionImpl().getAxisService()
+                    .addMessageElementQNameToOperationMapping(null, 
newAxisOperation);
             }
         }
         return newAxisOperation;

Modified: 
axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java?rev=1004667&r1=1004666&r2=1004667&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java
 Tue Oct  5 15:11:30 2010
@@ -173,10 +173,16 @@ public class DocLitBareResolveOperationT
 
         QName messageElementQName = new 
QName("http://description.jaxws.axis2.apache.org/";,
                                               "op7");
+        // We should *not* be able to find the operation based on a QName 
containing the name, but
+        // we should be able to find it based on a null.  That is because a 
Doc/Lit/Bare no-argument 
+        // message will have an empty soap:Body
         AxisOperation axisOperationFromElement =
                 
axisService.getOperationByMessageElementQName(messageElementQName);
         assertNull(axisOperationFromElement);
-
+        axisOperationFromElement =
+            axisService.getOperationByMessageElementQName(null);
+        assertNotNull(axisOperationFromElement);
+        assertEquals(axisOperationFromOpName, axisOperationFromElement);
     }
 
     public void testDocLitBareHeaderParamFirst() {


Reply via email to