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 2008/03/18 15:24:27 UTC

svn commit: r638383 - in /webservices/axis2/trunk/java/modules: jaxws-integration/test/org/apache/axis2/jaxws/sample/ jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/ jaxws/src/org/apache/axis2/jaxws/server/

Author: scheu
Date: Tue Mar 18 07:24:23 2008
New Revision: 638383

URL: http://svn.apache.org/viewvc?rev=638383&view=rev
Log:
AXIS2-3479
Contributor:Rich Scheuerle
Re-enabled tests
Re-enabled VERSION MISMATCH checking in EndpointController

Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java?rev=638383&r1=638382&r2=638383&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java Tue Mar 18 07:24:23 2008
@@ -60,7 +60,7 @@
      * -- setMTOMEnabled([true|false])
      * Using SOAP11
      */
-    public void _testSendImageAttachmentAPI11() throws Exception {
+    public void testSendImageAttachmentAPI11() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
         
@@ -104,7 +104,7 @@
      * Enable attachment optimization using the SOAP11 binding
      * property for MTOM.
      */
-    public void _testSendImageAttachmentProperty11() throws Exception {
+    public void testSendImageAttachmentProperty11() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
         
@@ -145,7 +145,7 @@
      * Enable attachment optimization using both the SOAP11 binding
      * property for MTOM and the Binding API
      */
-    public void _testSendImageAttachmentAPIProperty11() throws Exception {
+    public void testSendImageAttachmentAPIProperty11() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
         
@@ -194,7 +194,6 @@
      * Sending SOAP12 message to SOAP11 endpoint will correctly result in exception
      * 
      */
-/*
     public void testSendImageAttachmentProperty12() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
@@ -238,7 +237,6 @@
         
 
 	}
-  */
     
     /*
      * Enable attachment optimization using both the SOAP12 binding API
@@ -287,6 +285,8 @@
             SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
             fail("Was expecting an exception due to sending SOAP12 message to SOAP11 endpoint.");
         } catch (Exception e) {
+            System.out.println(e.getClass());
+            System.out.println(e.toString());
             assertNotNull(e);
         }
         /*

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java?rev=638383&r1=638382&r2=638383&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java Tue Mar 18 07:24:23 2008
@@ -34,6 +34,7 @@
 import javax.xml.ws.soap.SOAPBinding;
 import java.awt.*;
 import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 
 @WebService(serviceName="MtomSampleService",
 			endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample")
@@ -48,7 +49,7 @@
         ImageDepot output = (new ObjectFactory()).createImageDepot();
         Image image = null;
         try {
-            ByteArrayInputStream stream = (ByteArrayInputStream) data.getContent();
+            InputStream stream = (InputStream) data.getContent();
             image = ImageIO.read(stream);
             
             DataSource imageDS = new DataSourceImpl("image/jpeg", "test.jpg", image);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=638383&r1=638382&r2=638383&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Tue Mar 18 07:24:23 2008
@@ -45,6 +45,7 @@
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.axis2.jaxws.server.dispatcher.EndpointDispatcher;
 import org.apache.axis2.jaxws.server.dispatcher.factory.EndpointDispatcherFactory;
+import org.apache.axis2.jaxws.server.endpoint.Utils;
 import org.apache.axis2.jaxws.spi.Constants;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2006Constants;
@@ -192,16 +193,6 @@
     
     protected boolean handleRequest(EndpointInvocationContext eic) throws AxisFault, WebServiceException {
         
-
-
-        //Not needed since this is already handled when eic reaches this level
-        //if (!Utils.bindingTypesMatch(request, endpointDesc.getServiceDescription())) {
-        //    Protocol protocol = request.getMessage().getProtocol();
-        //    MessageContext faultContext = Utils.createVersionMismatchMessage(request, protocol);
-        //    eic.setResponseMessageContext(faultContext);
-        //    return false;
-        //}
-
         MessageContext responseMsgContext = null;
 
         try {
@@ -212,6 +203,15 @@
             Class serviceEndpoint = getServiceImplementation(request);
             EndpointDescription endpointDesc = getEndpointDescription(request);
             request.setEndpointDescription(endpointDesc);
+            
+            // Need to make sure the protocol (envelope ns)  of the request matches the binding
+            // expected by the service description
+            if (!Utils.bindingTypesMatch(request, endpointDesc.getServiceDescription())) {
+                Protocol protocol = request.getMessage().getProtocol();
+                MessageContext faultContext = Utils.createVersionMismatchMessage(request, protocol);
+                eic.setResponseMessageContext(faultContext);
+                return false;
+            }
             
             //  TODO: review: make sure the handlers are set on the InvocationContext
             //  This implementation of the JAXWS runtime does not use Endpoint, which



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