axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r474858 - in /webservices/axis2/trunk/java/modules/jaxws: ./ src/org/apache/axis2/jaxws/marshaller/impl/ test-resources/wsdl/ test/org/apache/axis2/jaxws/framework/ test/org/apache/axis2/jaxws/injection/ test/org/apache/axis2/jaxws/sample/ ...
Date Tue, 14 Nov 2006 16:31:15 GMT
Author: scheu
Date: Tue Nov 14 08:31:14 2006
New Revision: 474858

URL: http://svn.apache.org/viewvc?view=rev&rev=474858
Log:
AXIS2-1666
Contributor: Nikhil Thaker + minor fix from Rich Scheuerle
Enable the BareTests and add Resource Injection Changes

Added:
    webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/resourceinjection.wsdl
Modified:
    webservices/axis2/trunk/java/modules/jaxws/maven.xml
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
    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/injection/ResourceInjectionTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/services.xml

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=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws/maven.xml Tue Nov 14 08:31:14 2006
@@ -135,14 +135,14 @@
     	            <arg line="-d ${schema.generated.src.dir} -wsdl ${wsdl.source.dir}/EchoMessage.wsdl"/>
     	        </java>
     	<ant:echo>Generating java from resourceinjection.wsdl for javabean endpoint Resource
Injection support</ant:echo>
-		<!--
+		
     	<java classname="com.sun.tools.xjc.Driver" fork="true"> 
     	    <jvmarg line="${maven.junit.jvmargs}"/>
     	    <classpath refid="maven.dependency.classpath"/>
     	    <classpath location="${compiled.classes.dir}"/>
     	    <arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/resourceinjection.wsdl"/>
     	 </java>
-    	 -->
+    	
     	 
     	<!-- Compile the generated classes -->
     	<ant:echo>Compiling generated schema</ant:echo>

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java?view=diff&rev=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
Tue Nov 14 08:31:14 2006
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Set;
 
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.ws.Holder;
@@ -83,17 +84,16 @@
 				index++;
 			}
 
-
+            Object bo = null;
 			if(holdermps.size() == 0 && returnType.getName().equals("void")){
 				// No holders and return type void example --> public void someMethod() 
 				// I will return null for this case.
 				// doNothing as there is nothing to return.
-				return null;
+				
 			}
 			else if(holdermps.size() == 0 && !returnType.getName().equals("void")){
 				// No holders but a return type example --> public ReturnType someMethod()
-				Object bo = createBusinessObject(createContextPackageSet(), message);
-				return bo;
+				bo = createBusinessObject(createContextPackageSet(), message);
 			}
 			else if(holdermps.size()>0 && returnType.getName().equals("void")){
 				// Holders found and no return type example --> public void someMethod(Holder<AHolder>)

@@ -106,12 +106,14 @@
 				// WSGen and WsImport Generate Holders with return type as one of the Holder JAXBObject

 				// property, if wsdl schema forces a holder and a return type.
 				assignHolderValues(holdermps, holderArgs, message);
-				Object bo = createBusinessObject(createContextPackageSet(), message);
-				return bo;
+				bo = createBusinessObject(createContextPackageSet(), message);
 			}
 
+            if (bo instanceof JAXBElement) {
+                bo = ((JAXBElement) bo).getValue();
+            }
 
-			return null;
+			return bo;
 		} catch (Exception e) {
 			// Firewall.  Only WebServiceExceptions are thrown
 			throw ExceptionFactory.makeWebServiceException(e);
@@ -145,6 +147,13 @@
 	            bo = createBOFromBodyBlock(contextPackages,message);
 	        }
 	        
+            // The resulting business object may be a JAXBElement.
+            // In such cases get the contained type
+            if ( (actualType != JAXBElement.class) &&  
+                    bo instanceof JAXBElement) {
+                bo = ((JAXBElement) bo).getValue();
+            }
+            
             // Now create an argument from the business object
             Object arg = bo;
 	        if (paramDesc.isHolderType()) {
@@ -184,13 +193,7 @@
 			}
 			for(MethodParameter mp:mps){
 				ParameterDescription pd = mp.getParameterDescription();
-				if(pd.isHolderType()){
-					Object holderObject = mp.getValue();
-					objectList.add(holderObject);
-				}
-				else{
-					objectList.add(mp.getValue());
-				}
+				objectList.add(mp.getValue());
 			}
 			return objectList.toArray();		
 		} catch (Exception e) {

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java?view=diff&rev=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
Tue Nov 14 08:31:14 2006
@@ -660,12 +660,6 @@
 		return factory.createFrom(om,context,null);
 		
 	}
-
-	protected Block createEmptyBodyBlock() throws MessageException {
-		String emptyBody = "";
-		XMLStringBlockFactory stringFactory = (XMLStringBlockFactory) FactoryRegistry.getFactory(XMLStringBlockFactory.class);
-		return stringFactory.createFrom(emptyBody, null, SOAPENV_QNAME);
-	}
 	
 	protected String readXMLTypeName(Class jaxbClazz){
 		XmlType type = (XmlType)jaxbClazz.getAnnotation(XmlType.class);
@@ -841,10 +835,8 @@
 	}
 	
 	protected Message createEmptyMessage() throws JAXBException, MessageException, XMLStreamException
{
-		Block emptyBodyBlock = createEmptyBodyBlock();
 		MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
 		Message m = mf.create(protocol);
-		m.setBodyBlock(0,emptyBodyBlock);
 		return m;
 	}
 	

Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/resourceinjection.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/resourceinjection.wsdl?view=auto&rev=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/resourceinjection.wsdl
(added)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/resourceinjection.wsdl
Tue Nov 14 08:31:14 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://resourceinjection.sample.test.org"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="ResourceInjection" targetNamespace="http://resourceinjection.sample.test.org">
+  <wsdl:types>
+    <xsd:schema targetNamespace="http://resourceinjection.sample.test.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+      <xsd:element name="echoResponse">
+      	<xsd:complexType>
+      		<xsd:sequence>
+      			<xsd:element name="response" type="xsd:string"></xsd:element>
+      		</xsd:sequence>
+      	</xsd:complexType>
+      </xsd:element>
+      <xsd:element name="echo">
+      	<xsd:complexType>
+      		<xsd:sequence>
+      			<xsd:element name="arg" type="xsd:string"></xsd:element>
+      		</xsd:sequence>
+      	</xsd:complexType>
+      </xsd:element>
+    </xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="echoResponse">
+    <wsdl:part element="tns:echoResponse" name="echoResponse"/>
+  </wsdl:message>
+  <wsdl:message name="echo">
+    <wsdl:part element="tns:echo" name="echo"/>
+  </wsdl:message>
+  <wsdl:portType name="ResourceInjectionPortType">
+    <wsdl:operation name="echo">
+      <wsdl:input message="tns:echo"/>
+      <wsdl:output message="tns:echoResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="ResourceInjectionBinding" type="tns:ResourceInjectionPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="echo">
+      <soap:operation soapAction="http://resourceinjection.sample.test.org/NewOperation"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="ResourceInjectionService">
+    <wsdl:port binding="tns:ResourceInjectionBinding" name="ResourceInjectionPort">
+      <soap:address location="http://localhost:8080/axis2/services/ResourceInjectionService"/>
+    </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=474858&r1=474857&r2=474858
==============================================================================
--- 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 Nov 14 08:31:14 2006
@@ -56,6 +56,7 @@
 import org.apache.axis2.jaxws.proxy.ProxyTests;
 import org.apache.axis2.jaxws.sample.AddNumbersTests;
 import org.apache.axis2.jaxws.sample.AddressBookTests;
+import org.apache.axis2.jaxws.sample.BareTests;
 import org.apache.axis2.jaxws.sample.FaultsServiceTests;
 import org.apache.axis2.jaxws.sample.FaultyWebServiceTests;
 import org.apache.axis2.jaxws.sample.MtomSampleTests;
@@ -118,6 +119,7 @@
 
         suite.addTestSuite(AddressBookTests.class);
         suite.addTestSuite(MtomSampleTests.class);
+        suite.addTestSuite(BareTests.class);
         suite.addTestSuite(NonWrapTests.class);
         suite.addTestSuite(WrapTests.class);
         suite.addTestSuite(NonAnonymousComplexTypeTests.class);

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java?view=diff&rev=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java
Tue Nov 14 08:31:14 2006
@@ -123,7 +123,7 @@
 		}
 	}
 
-	/*
+	
     public void testEchoWithResourceInjectionAndLifecycleMethods(){
 		System.out.println("------------------------------");
 		System.out.println("Test : "+getName());
@@ -138,5 +138,5 @@
 			fail();
 		}
 	}
-    */
+   
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java?view=diff&rev=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
Tue Nov 14 08:31:14 2006
@@ -34,4 +34,27 @@
 			fail();
 		}
 	}
+	
+	public void testOneWayEmpty(){
+		System.out.println("------------------------------");
+		System.out.println("Test : "+getName());
+		
+		try{
+			
+			BareDocLitService service = new BareDocLitService();
+			DocLitBarePortType proxy = service.getBareDocLitPort();
+			 BindingProvider p = (BindingProvider) proxy;
+			
+	            p.getRequestContext().put(
+	                    BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+	            p.getRequestContext().put(
+	                    BindingProvider.SOAPACTION_URI_PROPERTY, "oneWayEmpty");
+			proxy.oneWayEmpty();
+			
+			System.out.println("------------------------------");
+		}catch(Exception e){
+			e.printStackTrace();
+			fail();
+		}
+	}
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/services.xml?view=diff&rev=474858&r1=474857&r2=474858
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/services.xml
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/services.xml
Tue Nov 14 08:31:14 2006
@@ -2,13 +2,9 @@
  <service name="BareDocLitService">
   <messageReceivers>
    <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
+   <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
   </messageReceivers>
   <parameter locked="false" name="ServiceClass">org.apache.axis2.jaxws.sample.doclitbare.DocLitBarePortTypeImpl</parameter>
-  <operation name="twoWaySimple" mep="http://www.w3.org/2004/08/wsdl/in-out">
-	<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
-	</messageReceivers>
-    <actionMapping>twoWaySimple<actionMapping/>
-  <operation/>
  </service>
 </serviceGroup>
 



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


Mime
View raw message