You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/04/10 21:25:26 UTC

svn commit: r527259 - in /webservices/axis2/trunk/java/modules/jaxws: ./ src/org/apache/axis2/jaxws/marshaller/impl/alt/ test-resources/wsdl/ test/org/apache/axis2/jaxws/framework/ test/org/apache/axis2/jaxws/proxy/ test/org/apache/axis2/jaxws/proxy/do...

Author: scheu
Date: Tue Apr 10 12:25:25 2007
New Revision: 527259

URL: http://svn.apache.org/viewvc?view=rev&rev=527259
Log:
AXIS2-2501
Contributor:Rich Scheuerle
Eliminate Doc/Lit Bare null checks...plus additional tests.

Added:
    webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/doclitbaremin.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/DocLitBareMinPortTypeImpl.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/services.xml
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/BareDocLitMinService.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/DocLitBareMinPortType.java
Modified:
    webservices/axis2/trunk/java/modules/jaxws/maven.xml
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ProxyDocLitnonWrapped.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/DocLitnonWrappedImpl.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/META-INF/proxy_doclit_unwr.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/maven.xml?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws/maven.xml Tue Apr 10 12:25:25 2007
@@ -649,6 +649,17 @@
 			   <ant:include name="org/apache/axis2/jaxws/server/**"/>
 			</ant:fileset>
 		</ant:copy>
+		<ant:copy toDir="target/test-classes/services/BareDocLitMinService/">
+			<ant:fileset dir="target/test-classes">
+			   <ant:include name="org/apache/axis2/jaxws/sample/doclitbaremin/**"/>
+			</ant:fileset>
+			<ant:fileset dir="test/org/apache/axis2/jaxws/sample/doclitbaremin">
+			   <ant:include name="META-INF/**"/>
+			</ant:fileset>
+			<ant:fileset dir="target/classes">
+			   <ant:include name="org/apache/axis2/jaxws/server/**"/>
+			</ant:fileset>
+		</ant:copy>
 		<ant:copy toDir="target/test-classes/services/EchoMessageService/">
 			<ant:fileset dir="target/test-classes">
 			   <ant:include name="org/apache/axis2/jaxws/nonanonymous/complextype/**"/>

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Tue Apr 10 12:25:25 2007
@@ -93,19 +93,11 @@
                     returnElement = MethodMarshallerUtils
                             .getReturnElement(packages, message, null, false, null, null);
                 }
-                //TODO should we allow null if the return is a header?
-                //Validate input parameters for operation and make sure no input parameters are null.
-                //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-                //to a method then an implementation MUST throw WebServiceException.
                 returnValue = returnElement.getTypeValue();
                 if (ConvertUtils.isConvertable(returnValue, returnType)) {
                 	returnValue = ConvertUtils.convert(returnValue, returnType);
                 }
-                if (returnValue == null) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                            "NullParamErr1", "Return", operationDesc.getJavaMethodName(),
-                            "doc/lit"));
-                }
+                
             }
 
             // Unmarshall the ParamValues from the Message
@@ -159,21 +151,6 @@
             // Build the signature arguments
             Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
 
-            // TODO This needs more work.  We need to check inside holders of input params.  We also
-            // may want to exclude header params from this check
-            //Validate input parameters for operation and make sure no input parameters are null.
-            //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-            //to a method then an implementation MUST throw WebServiceException.
-            if (sigArguments != null) {
-                for (Object argument : sigArguments) {
-                    if (argument == null) {
-                        throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                                "NullParamErr1", "Input", operationDesc.getJavaMethodName(),
-                                "doc/lit"));
-
-                    }
-                }
-            }
             return sigArguments;
         } catch (Exception e) {
             throw ExceptionFactory.makeWebServiceException(e);
@@ -225,16 +202,6 @@
             // Put the return object onto the message
             Class returnType = operationDesc.getResultActualType();
             if (returnType != void.class) {
-                // TODO should we allow null if the return is a header?
-                //Validate input parameters for operation and make sure no input parameters are null.
-                //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-                //to a method then an implementation MUST throw WebServiceException.
-                if (returnObject == null) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                            "NullParamErr1", "Return", operationDesc.getJavaMethodName(),
-                            "doc/lit"));
-
-                }
                 Element returnElement = null;
                 QName returnQName = new QName(operationDesc.getResultTargetNamespace(),
                                               operationDesc.getResultName());

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java Tue Apr 10 12:25:25 2007
@@ -109,12 +109,7 @@
                 returnValue = returnElement.getTypeValue();
                 if (ConvertUtils.isConvertable(returnValue, returnType)) {
                 	returnValue = ConvertUtils.convert(returnValue, returnType);
-                }                
-                if (returnValue == null) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                            "NullParamErr1", "Return", operationDesc.getJavaMethodName(),
-                            "doc/lit"));
-                }
+                }               
             }
 
             // We want to use "by Java Type" unmarshalling for 
@@ -195,22 +190,6 @@
 
             // Build the signature arguments
             Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
-
-            // TODO This needs more work.  We need to check inside holders of input params.  We also
-            // may want to exclude header params from this check
-            //Validate input parameters for operation and make sure no input parameters are null.
-            //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-            //to a method then an implementation MUST throw WebServiceException.
-            if (sigArguments != null) {
-                for (Object argument : sigArguments) {
-                    if (argument == null) {
-                        throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                                "NullParamErr1", "Input", operationDesc.getJavaMethodName(),
-                                "doc/lit"));
-
-                    }
-                }
-            }
             return sigArguments;
         } catch (Exception e) {
             throw ExceptionFactory.makeWebServiceException(e);
@@ -262,16 +241,6 @@
             // Put the return object onto the message
             Class returnType = operationDesc.getResultActualType();
             if (returnType != void.class) {
-                // TODO should we allow null if the return is a header?
-                //Validate input parameters for operation and make sure no input parameters are null.
-                //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-                //to a method then an implementation MUST throw WebServiceException.
-                if (returnObject == null) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                            "NullParamErr1", "Return", operationDesc.getJavaMethodName(),
-                            "doc/lit"));
-
-                }
 
                 // Use byJavaType marshalling if necessary
                 Class byJavaType = null;
@@ -347,27 +316,6 @@
                     MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
 
-            // TODO This needs more work.  We need to check inside holders of input params.  We also
-            // may want to exclude header params from this check
-            //Validate input parameters for operation and make sure no input parameters are null.
-            //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument 
-            //to a method then an implementation MUST throw WebServiceException.
-            if (pds.length > 0) {
-                if (signatureArguments == null) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                            "NullParamErr1", "Input", operationDesc.getJavaMethodName(),
-                            "doc/lit"));
-                }
-                if (signatureArguments != null) {
-                    for (Object argument : signatureArguments) {
-                        if (argument == null) {
-                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
-                                    "NullParamErr1", "Input", operationDesc.getJavaMethodName(),
-                                    "doc/lit"));
-                        }
-                    }
-                }
-            }
             // Create the message 
             MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
             Message m = mf.create(protocol);

Modified: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ProxyDocLitnonWrapped.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ProxyDocLitnonWrapped.wsdl?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ProxyDocLitnonWrapped.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ProxyDocLitnonWrapped.wsdl Tue Apr 10 12:25:25 2007
@@ -20,7 +20,7 @@
 			
 			
 			
-			<xsd:element name="invoke">
+			<xsd:element name="invoke" nillable="true">
 				<xsd:complexType>
 					<xsd:sequence>
 						<xsd:element name="invoke_str" type="xsd:string" />
@@ -28,7 +28,7 @@
 				</xsd:complexType>
 			</xsd:element>			
 			
-			<xsd:element name="ReturnType">
+			<xsd:element name="ReturnType" nillable="true">
 				<xsd:complexType>
 					<xsd:sequence>
 						<xsd:element name="return_str" type="xsd:string" />

Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/doclitbaremin.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/doclitbaremin.wsdl?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/doclitbaremin.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/doclitbaremin.wsdl Tue Apr 10 12:25:25 2007
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:tns="http://doclitbaremin.sample.test.org"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DoclitBareMin"
+	targetNamespace="http://doclitbaremin.sample.test.org">
+	
+	<wsdl:types>
+		<xsd:schema
+			targetNamespace="http://doclitbaremin.sample.test.org"
+			xmlns:tns="http://doclitbaremin.sample.test.org"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+		
+		<xsd:element name="String" type="xsd:string" />
+
+		</xsd:schema>
+	</wsdl:types>
+
+	<wsdl:message name="SingleParam">
+		<wsdl:part name="allByMyself" element="tns:String" />
+	</wsdl:message>
+
+	<wsdl:portType name="DocLitBareMinPortType">
+		
+		<wsdl:operation name="echo">
+			<wsdl:input message="tns:SingleParam" />
+			<wsdl:output message="tns:SingleParam" />
+		</wsdl:operation>
+			
+	</wsdl:portType>
+	
+	<wsdl:binding name="DocLitBareMin" type="tns:DocLitBareMinPortType">
+		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+		
+		<wsdl:operation name="echo">
+			<wsdl:input>
+				<soap:body use="literal"  />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"  />
+			</wsdl:output>
+		</wsdl:operation>	
+		
+	
+	</wsdl:binding>
+	
+	<wsdl:service name="BareDocLitMinService">
+		<wsdl:port binding="tns:DocLitBareMin" name="BareDocLitMinPort">
+			<soap:address location="http://localhost:8080/axis2/services/BareDocLitMinService" />
+		</wsdl:port>
+	</wsdl:service>
+	
+</wsdl:definitions>

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Tue Apr 10 12:25:25 2007
@@ -68,6 +68,7 @@
 import org.apache.axis2.jaxws.sample.AddressBookTests;
 import org.apache.axis2.jaxws.sample.BareTests;
 import org.apache.axis2.jaxws.sample.DLWMinTests;
+import org.apache.axis2.jaxws.sample.DocLitBareMinTests;
 import org.apache.axis2.jaxws.sample.FaultsServiceTests;
 import org.apache.axis2.jaxws.sample.FaultyWebServiceTests;
 import org.apache.axis2.jaxws.sample.MtomSampleTests;
@@ -150,6 +151,7 @@
         // TODO: This test fails only on Solaris
         //suite.addTestSuite(MtomSampleByteArrayTests.class);
         suite.addTestSuite(BareTests.class);
+        suite.addTestSuite(DocLitBareMinTests.class);
         suite.addTestSuite(NonWrapTests.class);
         suite.addTestSuite(WSGenTests.class);
         suite.addTestSuite(WrapTests.class);

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java Tue Apr 10 12:25:25 2007
@@ -77,6 +77,24 @@
         System.out.println("-------------------------------------");
     }
     
+    public void testNullInvoke(){
+        System.out.println("-----------------------------------");
+        System.out.println("test: " + getName());
+        System.out.println(">>Testing Sync Invoke on Proxy DocLit bare with a null parameter");
+        ObjectFactory factory = new ObjectFactory();
+        Invoke invokeObj = null;
+        Service service = Service.create(null, serviceName);
+        assertNotNull(service);
+        DocLitnonWrappedProxy proxy = service.getPort(portName, DocLitnonWrappedProxy.class);
+        assertNotNull(proxy);
+        BindingProvider p = (BindingProvider)proxy;
+        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+        ReturnType response = proxy.invoke(invokeObj);
+        assertNull(response);
+        
+        System.out.println("-------------------------------------");
+    }
+    
     public void testInvokeAsyncCallback(){
         try{ 
             System.out.println("---------------------------------------");

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/DocLitnonWrappedImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/DocLitnonWrappedImpl.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/DocLitnonWrappedImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/DocLitnonWrappedImpl.java Tue Apr 10 12:25:25 2007
@@ -29,12 +29,15 @@
 		// TODO Auto-generated constructor stub
 	}
 
-	/* (non-Javadoc)
-	 * @see javax.xml.ws.Provider#invoke(T)
-	 */
-	public String invoke(String invoke_str) {
-		System.out.println("End point called with String value =" + invoke_str);
-		return new String("<ns2:ReturnType xmlns:ns2=\"http://doclitnonwrapped.proxy.test.org\"><return_str>some response</return_str></ns2:ReturnType>");
-	}
-
+    /* (non-Javadoc)
+     * @see javax.xml.ws.Provider#invoke(T)
+     */
+    public String invoke(String invoke_str) {
+        System.out.println("End point called with String value =" + invoke_str);
+        if (invoke_str.contains("nil")) {
+            return new String("<ns2:ReturnType xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns2=\"http://doclitnonwrapped.proxy.test.org\"/>");
+        } else {
+            return new String("<ns2:ReturnType xmlns:ns2=\"http://doclitnonwrapped.proxy.test.org\"><return_str>some response</return_str></ns2:ReturnType>");
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/META-INF/proxy_doclit_unwr.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/META-INF/proxy_doclit_unwr.wsdl?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/META-INF/proxy_doclit_unwr.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/doclitnonwrapped/META-INF/proxy_doclit_unwr.wsdl Tue Apr 10 12:25:25 2007
@@ -20,7 +20,7 @@
 			
 			
 			
-			<xsd:element name="invoke">
+			<xsd:element name="invoke" nillable="true">
 				<xsd:complexType>
 					<xsd:sequence>
 						<xsd:element name="invoke_str" type="xsd:string" />
@@ -28,7 +28,7 @@
 				</xsd:complexType>
 			</xsd:element>			
 			
-			<xsd:element name="ReturnType">
+			<xsd:element name="ReturnType" nillable="true">
 				<xsd:complexType>
 					<xsd:sequence>
 						<xsd:element name="return_str" type="xsd:string" />

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DocLitBareMinTests.java Tue Apr 10 12:25:25 2007
@@ -0,0 +1,35 @@
+/**
+ * 
+ */
+package org.apache.axis2.jaxws.sample;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Holder;
+
+import org.apache.axis2.jaxws.sample.doclitbaremin.sei.BareDocLitMinService;
+import org.apache.axis2.jaxws.sample.doclitbaremin.sei.DocLitBareMinPortType;
+
+import junit.framework.TestCase;
+
+
+public class DocLitBareMinTests extends TestCase {
+	
+    public void testEcho() throws Exception {
+        System.out.println("------------------------------");
+        System.out.println("Test : "+getName());
+        
+        
+        BareDocLitMinService service = new BareDocLitMinService();
+        DocLitBareMinPortType proxy = service.getBareDocLitMinPort();
+        BindingProvider p = (BindingProvider) proxy;
+        p.getRequestContext().put(
+                BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+        p.getRequestContext().put(
+                BindingProvider.SOAPACTION_URI_PROPERTY, "echo");
+        String request = "dlroW elloH";
+        String response = proxy.echo(request);
+        
+        assertTrue(request.equals(response));
+        
+    }
+}

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java?view=diff&rev=527259&r1=527258&r2=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java Tue Apr 10 12:25:25 2007
@@ -48,6 +48,36 @@
 			fail();
 		}
 	}
+    
+    public void testTwoWaySyncNull() throws Exception{
+        System.out.println("------------------------------");
+        System.out.println("Test : "+getName());
+        try{
+            TwoWay twoWay = null;  // This should cause an WebServiceException
+            DocLitNonWrapService service = new DocLitNonWrapService();
+            DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+            ReturnType returnValue = proxy.twoWay(twoWay);
+            
+            // TODO Revisit JAXB validation
+            // JAXWS does not make the decision of whether a
+            // null parameter can be marshalled.  This decision is
+            // delegated to JAXB.  In this case, the schema indicates
+            // that this is not a nillable element.  The assumption is
+            // that JAXB will fail.  However the current version of 
+            // JAXB considers this as 'validation checking' and is not
+            // supported.  Thus JAXB will marshal the element without
+            // an exception (and unmarshal without exception) even though
+            // this is a violation of the schema.
+            
+            
+            
+            //fail("Expected WebServiceException");
+            
+            
+        } catch(WebServiceException e){
+            System.out.println(e.toString());
+        }
+    }
 
 	public void testTwoWayASyncCallback(){
 		System.out.println("------------------------------");

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/DocLitBareMinPortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/DocLitBareMinPortTypeImpl.java?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/DocLitBareMinPortTypeImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/DocLitBareMinPortTypeImpl.java Tue Apr 10 12:25:25 2007
@@ -0,0 +1,21 @@
+package org.apache.axis2.jaxws.sample.doclitbaremin;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+import org.apache.axis2.jaxws.sample.doclitbaremin.sei.DocLitBareMinPortType;
+
+/**
+ * Test DocLitBareMinPort
+ */
+@WebService(endpointInterface="org.apache.axis2.jaxws.sample.doclitbaremin.sei.DocLitBareMinPortType")
+public class DocLitBareMinPortTypeImpl implements DocLitBareMinPortType {
+
+    /* 
+     * echo
+     */
+    public String echo(String allByMyself) {
+        return allByMyself;
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl Tue Apr 10 12:25:25 2007
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:tns="http://doclitbaremin.sample.test.org"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DoclitBareMin"
+	targetNamespace="http://doclitbaremin.sample.test.org">
+	
+	<wsdl:types>
+		<xsd:schema
+			targetNamespace="http://doclitbaremin.sample.test.org"
+			xmlns:tns="http://doclitbaremin.sample.test.org"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+		
+		<xsd:element name="String" type="xsd:string" />
+
+		</xsd:schema>
+	</wsdl:types>
+
+	<wsdl:message name="SingleParam">
+		<wsdl:part name="allByMyself" element="tns:String" />
+	</wsdl:message>
+
+	<wsdl:portType name="DocLitBareMinPortType">
+		
+		<wsdl:operation name="echo">
+			<wsdl:input message="tns:SingleParam" />
+			<wsdl:output message="tns:SingleParam" />
+		</wsdl:operation>
+			
+	</wsdl:portType>
+	
+	<wsdl:binding name="DocLitBareMin" type="tns:DocLitBareMinPortType">
+		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+		
+		<wsdl:operation name="echo">
+			<wsdl:input>
+				<soap:body use="literal"  />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"  />
+			</wsdl:output>
+		</wsdl:operation>	
+		
+	
+	</wsdl:binding>
+	
+	<wsdl:service name="BareDocLitMinService">
+		<wsdl:port binding="tns:DocLitBareMin" name="BareDocLitMinPort">
+			<soap:address location="http://localhost:8080/axis2/services/BareDocLitMinService" />
+		</wsdl:port>
+	</wsdl:service>
+	
+</wsdl:definitions>

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/services.xml?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/services.xml (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/services.xml Tue Apr 10 12:25:25 2007
@@ -0,0 +1,9 @@
+<serviceGroup>
+ <service name="BareDocLitMinService">
+  <messageReceivers>
+   <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
+  </messageReceivers>
+  <parameter locked="false" name="ServiceClass">org.apache.axis2.jaxws.sample.doclitbaremin.DocLitBareMinPortTypeImpl</parameter>
+ </service>
+</serviceGroup>
+

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/BareDocLitMinService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/BareDocLitMinService.java?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/BareDocLitMinService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/BareDocLitMinService.java Tue Apr 10 12:25:25 2007
@@ -0,0 +1,62 @@
+
+package org.apache.axis2.jaxws.sample.doclitbaremin.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;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ * 
+ */
+@WebServiceClient(name = "BareDocLitMinService", targetNamespace = "http://org.test.sample.doclitbaremin", wsdlLocation = "doclitbaremin.wsdl")
+public class BareDocLitMinService
+    extends Service
+{
+
+    private final static URL BAREDOCLITMINSERVICE_WSDL_LOCATION;
+
+    private static String wsdlLocation="/test/org/apache/axis2/jaxws/sample/doclitbaremin/META-INF/doclitbaremin.wsdl";
+    static {
+        URL url = null;
+        try {
+        	try{
+	        	String baseDir = new File(System.getProperty("basedir",".")).getCanonicalPath();
+	        	wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath();
+        	}catch(Exception e){
+        		e.printStackTrace();
+        	}
+        	File file = new File(wsdlLocation);
+        	url = file.toURL();
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+        BAREDOCLITMINSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BareDocLitMinService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BareDocLitMinService() {
+        super(BAREDOCLITMINSERVICE_WSDL_LOCATION, new QName("http://doclitbaremin.sample.test.org", "BareDocLitMinService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns DocLitBarePortType
+     */
+    @WebEndpoint(name = "BareDocLitMinPort")
+    public DocLitBareMinPortType getBareDocLitMinPort() {
+        return (DocLitBareMinPortType)super.getPort(new QName("http://doclitbaremin.sample.test.org", "BareDocLitMinPort"), DocLitBareMinPortType.class);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/DocLitBareMinPortType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/DocLitBareMinPortType.java?view=auto&rev=527259
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/DocLitBareMinPortType.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbaremin/sei/DocLitBareMinPortType.java Tue Apr 10 12:25:25 2007
@@ -0,0 +1,39 @@
+
+package org.apache.axis2.jaxws.sample.doclitbaremin.sei;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.ws.Holder;
+
+
+
+/**
+ * Tests doc/lit bare minimal
+ * (Minimal indicates that no ObjectFactory is available to do the parameter marshalling/demarshalling)
+ * 
+ */
+@WebService(name = "DocLitBareMinPortType", targetNamespace = "http://doclitbaremin.sample.test.org")
+@SOAPBinding(parameterStyle = ParameterStyle.BARE)
+public interface DocLitBareMinPortType {
+
+    
+    /**
+     * echo
+     * @param allByMyself
+     * @return
+     *     returns java.lang.String
+     */
+    @WebMethod
+    @WebResult(name = "String", targetNamespace = "http://doclitbaremin.sample.test.org", partName = "allByMyself")
+    public String echo(
+        @WebParam(name = "String", targetNamespace = "http://doclitbaremin.sample.test.org", partName = "allByMyself")
+        String allByMyself);
+        
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org