You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2008/03/19 03:38:55 UTC

svn commit: r638686 - in /webservices/axis2/trunk/java/modules: jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/ jaxws-integration/test/org/apache/axis2/jaxws/provider/source/ jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg...

Author: dims
Date: Tue Mar 18 19:38:52 2008
New Revision: 638686

URL: http://svn.apache.org/viewvc?rev=638686&view=rev
Log:
- Fix for AXIS2-3479 - [Break] MtomSampleTests - The org.apache.axis2.jaxws.sample.MtomSampleTests suite is failing
- Switching on generic operations for SOAP Bindings, so that we don't have to supply wsdl's for a soap provider.
- Fix bad annotation in the providers (HTTP_BINDING -> SOAP11HTTP_BINDING)

Question: Is this the right thing to do? If yes, we need to clean up the commented out test in GenericOperationProviderTest. We definitely need to switch on the version check in EndpointController.


Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/stringmsg/StringMessageProvider.java
    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/security/server/SecurityProvider.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/GenericOperationProviderTest.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java Tue Mar 18 19:38:52 2008
@@ -32,6 +32,7 @@
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.http.HTTPBinding;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -41,7 +42,7 @@
  *
  */
 @WebServiceProvider(serviceName="JAXBProviderService")
-@BindingType(HTTPBinding.HTTP_BINDING)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
 public class JAXBProvider implements Provider<Source> {
     
     /**

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java Tue Mar 18 19:38:52 2008
@@ -34,13 +34,14 @@
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceException;
 import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.http.HTTPBinding;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.io.StringWriter;
 
 @WebServiceProvider(serviceName="SourceProviderService")
-@BindingType(HTTPBinding.HTTP_BINDING)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
 public class SourceProvider implements Provider<Source> {
     
     // Same logic as StringProvider

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java Tue Mar 18 19:38:52 2008
@@ -30,13 +30,14 @@
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.http.HTTPBinding;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.io.StringWriter;
 
 @WebServiceProvider(serviceName="SourceMessageProviderService")
-@BindingType(HTTPBinding.HTTP_BINDING)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
 public class SourceMessageProvider implements Provider<Source> {
     String responseAsString = new String("<?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header/><soapenv:Body><ns2:ReturnType xmlns:ns2=\"http://test\"><return_str>some response</return_str></ns2:ReturnType></soapenv:Body></soapenv:Envelope>");
     public Source invoke(Source source) {

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/stringmsg/StringMessageProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/stringmsg/StringMessageProvider.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/stringmsg/StringMessageProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/provider/stringmsg/StringMessageProvider.java Tue Mar 18 19:38:52 2008
@@ -24,10 +24,11 @@
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.http.HTTPBinding;
 
 @WebServiceProvider(serviceName="StringMessageProviderService")
-@BindingType(HTTPBinding.HTTP_BINDING)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
 public class StringMessageProvider implements Provider<String> {
     private static String responseGood = "<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header /><soapenv:Body><provider><message>request processed</message></provider></soapenv:Body></soapenv:Envelope>";
     private static String responseBad  = "<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header /><soapenv:Body><provider><message>ERROR:null request received</message><provider></soapenv:Body></soapenv:Envelope>";

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=638686&r1=638685&r2=638686&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 19:38:52 2008
@@ -194,7 +194,7 @@
      * Sending SOAP12 message to SOAP11 endpoint will correctly result in exception
      * 
      */
-    public void _testSendImageAttachmentProperty12() throws Exception {
+    public void testSendImageAttachmentProperty12() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
         
@@ -245,7 +245,7 @@
      * Sending SOAP12 message to SOAP11 endpoint will correctly result in exception
      * 
      */
-    public void _testSendImageAttachmentAPI12() throws Exception {
+    public void testSendImageAttachmentAPI12() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
         

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/server/SecurityProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/server/SecurityProvider.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/server/SecurityProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/server/SecurityProvider.java Tue Mar 18 19:38:52 2008
@@ -24,10 +24,11 @@
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.http.HTTPBinding;
 
 @WebServiceProvider(serviceName="BasicAuthSecurityService",portName="SimpleProviderServiceSOAP11port0")
-@BindingType(HTTPBinding.HTTP_BINDING)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
 public class SecurityProvider implements Provider<String> {
 
     private static String responseGood = "<provider><message>request processed</message></provider>";

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=638686&r1=638685&r2=638686&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 19:38:52 2008
@@ -204,14 +204,14 @@
             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;
-//            }
+            // 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

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/GenericOperationProviderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/GenericOperationProviderTest.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/GenericOperationProviderTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/GenericOperationProviderTest.java Tue Mar 18 19:38:52 2008
@@ -79,7 +79,7 @@
         }
     }
     
-    public void testGenericSOAPBindingOperation() {
+    public void _testGenericSOAPBindingOperation() {
         // REVIEW: Currently generic operations are not supported for SOAP Bindings
         
         ServiceDescription serviceDesc = DescriptionFactory.createServiceDescription(SOAPBindingProviderImpl.class);

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=638686&r1=638685&r2=638686&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Tue Mar 18 19:38:52 2008
@@ -667,10 +667,10 @@
             if (log.isDebugEnabled()) {
                 log.debug("WebServiceProvider without WSDL encountered");
             }
-            // REVIEW: Currently this is only supported for HTTP Bindings; SOAPBindings
-            //     for providers currently require that there be WSDL.
             String bindingType = getBindingType();
-            if (javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(bindingType)) {
+            if (javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(bindingType)||
+                    SOAPBinding.SOAP11HTTP_BINDING.equals(bindingType)||
+                    SOAPBinding.SOAP12HTTP_BINDING.equals(bindingType)) {
                 endpointInterfaceDescription = new EndpointInterfaceDescriptionImpl(composite, this);
             }
         }



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