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 pr...@apache.org on 2007/09/10 15:01:28 UTC

svn commit: r574230 - in /webservices/axis2/branches/java/jaxws21/modules: jaxws/src/org/apache/axis2/jaxws/addressing/ jaxws/src/org/apache/axis2/jaxws/binding/ jaxws/src/org/apache/axis2/jaxws/client/config/ jaxws/src/org/apache/axis2/jaxws/context/ ...

Author: pradine
Date: Mon Sep 10 06:01:25 2007
New Revision: 574230

URL: http://svn.apache.org/viewvc?rev=574230&view=rev
Log:
Add support for processing WebServiceFeature annotations on the server-side.

Added:
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
      - copied unchanged from r572368, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
      - copied unchanged from r572368, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java
Removed:
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ConfigFramework.java
Modified:
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java Mon Sep 10 06:01:25 2007
@@ -26,11 +26,11 @@
 import javax.xml.ws.WebServiceFeature;
 import javax.xml.ws.handler.Handler;
 
+import org.apache.axis2.jaxws.client.config.RespectBindingConfigurator;
 import org.apache.axis2.jaxws.core.MessageContext;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.feature.ClientConfigurator;
 import org.apache.axis2.jaxws.feature.ClientFramework;
-import org.apache.axis2.jaxws.feature.config.RespectBindingConfigurator;
 import org.apache.axis2.jaxws.handler.HandlerResolverImpl;
 import org.apache.axis2.jaxws.spi.Binding;
 import org.apache.axis2.jaxws.spi.BindingProvider;

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java Mon Sep 10 06:01:25 2007
@@ -20,10 +20,10 @@
 
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+import org.apache.axis2.jaxws.client.config.AddressingConfigurator;
+import org.apache.axis2.jaxws.client.config.MTOMConfigurator;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.feature.ClientConfigurator;
-import org.apache.axis2.jaxws.feature.config.MTOMConfigurator;
-import org.apache.axis2.jaxws.feature.config.AddressingConfigurator;
 import org.apache.axis2.jaxws.utility.SAAJFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,165 @@
+/*
+ * 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.client.config;
+
+import javax.xml.ws.soap.AddressingFeature;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.AddressingConstants.Final;
+import org.apache.axis2.addressing.AddressingConstants.Submission;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.ClientConfigurator;
+import org.apache.axis2.jaxws.spi.Binding;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class AddressingConfigurator implements ClientConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.WebServiceFeatureConfigurator#configure(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+     */
+    public void configure(MessageContext messageContext, BindingProvider provider) {
+        Binding bnd = (Binding) provider.getBinding();
+        AddressingFeature addressingFeature =
+            (AddressingFeature) bnd.getWebServiceFeature(AddressingFeature.ID);
+        SubmissionAddressingFeature submissionAddressingFeature =
+            (SubmissionAddressingFeature) bnd.getWebServiceFeature(SubmissionAddressingFeature.ID);
+        String specifiedAddressingNamespace = provider.getAddressingNamespace();
+        String enabledAddressingNamespace =
+            (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+        Boolean disableAddressing =
+            (Boolean) messageContext.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+        
+        //Figure out which WS-Addressing feature was specified causing this configurator to run. 
+        if (addressingFeature != null && submissionAddressingFeature != null) {
+            //Both features must have been specified.
+            boolean w3cAddressingEnabled = addressingFeature.isEnabled();
+            boolean submissionAddressingEnabled = submissionAddressingFeature.isEnabled();
+            
+            if (w3cAddressingEnabled && submissionAddressingEnabled) {
+                //If WS-Addressing has already been enabled then stop,
+                //as this configurator has probably already run once.
+                if (!disableAddressing)
+                    return;
+                
+                //If an EPR hasn't been specified then default to 2005/08 addressing,
+                //else use the namespace of the EPR.
+                if (specifiedAddressingNamespace == null)
+                    specifiedAddressingNamespace = Final.WSA_NAMESPACE;
+                
+                disableAddressing = Boolean.FALSE;
+            }
+            else if (w3cAddressingEnabled) {
+                //Enable only 2005/08 addressing
+                if (Submission.WSA_NAMESPACE.equals(specifiedAddressingNamespace))
+                    throw ExceptionFactory.makeWebServiceException("Illegal configuration.");
+                else
+                    specifiedAddressingNamespace = Final.WSA_NAMESPACE;
+                
+                disableAddressing = Boolean.FALSE;
+            }
+            else if (submissionAddressingEnabled) {
+                //Enable only 2004/08 addressing
+                if (Final.WSA_NAMESPACE.equals(specifiedAddressingNamespace))
+                    throw ExceptionFactory.makeWebServiceException("Illegal configuration.");
+                else
+                    specifiedAddressingNamespace = Submission.WSA_NAMESPACE;
+                
+                disableAddressing = Boolean.FALSE;
+            }
+            else {
+                //Disable 2005/08 and 2004/08 addressing
+                disableAddressing = Boolean.TRUE;
+            }                
+        }
+        else if (addressingFeature != null) {
+            //The AddressingFeature must have been specified.
+            boolean w3cAddressingEnabled = addressingFeature.isEnabled();
+
+            if (w3cAddressingEnabled) {
+                //Enable 2005/08 addressing
+                if (Submission.WSA_NAMESPACE.equals(specifiedAddressingNamespace))
+                    throw ExceptionFactory.makeWebServiceException("Illegal configuration.");
+                else
+                    specifiedAddressingNamespace = Final.WSA_NAMESPACE;
+                
+                disableAddressing = Boolean.FALSE;
+            }
+            else {
+                //Disable 2005/08 addressing
+                if (enabledAddressingNamespace == null ||
+                        Final.WSA_NAMESPACE.equals(enabledAddressingNamespace))
+                    disableAddressing = Boolean.TRUE;
+            }                
+        }
+        else if (submissionAddressingFeature != null) {
+            //The SubmissionAddressingFeature must have been specified.
+            boolean submissionAddressingEnabled = submissionAddressingFeature.isEnabled();
+            
+            if (submissionAddressingEnabled) {
+                //Enable 2004/08 addressing
+                if (Final.WSA_NAMESPACE.equals(specifiedAddressingNamespace))
+                    throw ExceptionFactory.makeWebServiceException("Illegal configuration.");
+                else
+                    specifiedAddressingNamespace = Submission.WSA_NAMESPACE;
+                
+                disableAddressing = Boolean.FALSE;
+            }
+            else {
+                //Disable 2004/08 addressing
+                if (enabledAddressingNamespace == null ||
+                        Submission.WSA_NAMESPACE.equals(enabledAddressingNamespace))
+                    disableAddressing = Boolean.TRUE;
+            }                
+        }
+        else {
+            //If neither were specified then this configurator should never run.
+            throw ExceptionFactory.makeWebServiceException("Both WS-Addressing features were unspecified.");
+        }
+        
+        if (!disableAddressing) {
+            try {
+                EndpointReference epr = provider.getAxis2EndpointReference(specifiedAddressingNamespace);
+                org.apache.axis2.context.MessageContext axis2MessageContext = messageContext.getAxisMessageContext();
+                axis2MessageContext.setTo(epr);
+                
+                ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
+                AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
+                if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING))
+                    axisConfig.engageModule(Constants.MODULE_ADDRESSING);
+            }
+            catch (Exception e) {
+                //TODO NLS enable.
+                throw ExceptionFactory.makeWebServiceException("Unable to engage the addressing module.", e);
+            }
+        }
+
+        messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, specifiedAddressingNamespace);                        
+        messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, disableAddressing);
+    }
+}

Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,99 @@
+/*
+ * 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.client.config;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.feature.ClientConfigurator;
+import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.spi.Binding;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class MTOMConfigurator implements ClientConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+     */
+    public void configure(MessageContext messageContext, BindingProvider provider) {
+        Binding bnd = (Binding) provider.getBinding();
+        MTOMFeature mtomFeature = (MTOMFeature) bnd.getWebServiceFeature(MTOMFeature.ID);
+        Message requestMsg = messageContext.getMessage();
+        
+        //Disable MTOM.
+        requestMsg.setMTOMEnabled(false);
+                
+//      TODO NLS enable.
+        if (mtomFeature == null)
+            throw ExceptionFactory.makeWebServiceException("The MTOM features was unspecified.");
+
+        //Enable MTOM if specified.
+        if (mtomFeature.isEnabled()) {
+            int threshold = mtomFeature.getThreshold();
+            List<String> attachmentIDs = requestMsg.getAttachmentIDs();
+            
+            if (attachmentIDs != null) {
+            	long size = 0L;
+            	
+        		for (String attachmentID : attachmentIDs) {
+        			DataHandler dh = requestMsg.getDataHandler(attachmentID);
+        			
+        			if (dh != null) {
+        				DataSource ds = dh.getDataSource();
+                    	InputStream is = null;
+                    	
+        				try {
+        					is = ds.getInputStream();
+        					size += is.available();
+        				}
+                    	catch (Exception e) {
+//                    		TODO NLS enable.
+                    		throw ExceptionFactory.makeWebServiceException("Unable to determine the size of the attachment(s).", e);
+                    	}
+                    	finally {
+                    		try {
+                    			if (is != null)
+                    				is.close();
+                    		}
+                    		catch (Exception e) {
+                    			//Nothing to do.
+                    		}
+                    	}
+        			}
+        		}
+            	
+            	if (size > threshold)
+                    requestMsg.setMTOMEnabled(true);
+            }
+        }
+        else {
+        	
+        }
+    }
+}

Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,50 @@
+/*
+ * 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.client.config;
+
+import javax.xml.ws.RespectBindingFeature;
+
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.feature.ClientConfigurator;
+import org.apache.axis2.jaxws.spi.Binding;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class RespectBindingConfigurator implements ClientConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+     */
+    public void configure(MessageContext messageContext, BindingProvider provider) {
+        Binding bnd = (Binding) provider.getBinding();
+        RespectBindingFeature respectBindingFeature =
+            (RespectBindingFeature) bnd.getWebServiceFeature(RespectBindingFeature.ID);
+        
+        if (respectBindingFeature == null)
+            throw ExceptionFactory.makeWebServiceException("The respect binding features was unspecified.");
+        
+        if (respectBindingFeature.isEnabled()) {
+            //TODO Implementation required.
+        }
+    }
+}

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java Mon Sep 10 06:01:25 2007
@@ -112,6 +112,8 @@
         EndpointReference jaxwsEPR = null;
         String addressingNamespace = getAddressingNamespace(clazz);
         
+        //TODO: Need to understand how the binding can influence the behaviour of this method.
+        
         if (soapMessageContext != null) {
             QName service = (QName) soapMessageContext.get(MessageContext.WSDL_SERVICE);
             QName endpoint = (QName) soapMessageContext.get(MessageContext.WSDL_PORT);

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java Mon Sep 10 06:01:25 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.axis2.jaxws.feature;
 
+import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.core.MessageContext;
 import org.apache.axis2.jaxws.spi.BindingProvider;
 
@@ -26,12 +27,16 @@
 import java.util.IdentityHashMap;
 import java.util.Map;
 
-public class ClientFramework extends ConfigFramework {
+public class ClientFramework {
+    private static final WebServiceFeature[] ZERO_LENGTH_ARRAY = new WebServiceFeature[0];
+    
     private Map<String, ClientConfigurator> configuratorMap;
+    private Map<String, WebServiceFeature> featureMap;
     
     public ClientFramework() {
     	super();
         configuratorMap = new IdentityHashMap<String, ClientConfigurator>();
+        featureMap = new IdentityHashMap<String, WebServiceFeature>();
     }
     
     public void addConfigurator(String id, ClientConfigurator configurator) {
@@ -43,6 +48,22 @@
             return false;
         
         return configuratorMap.containsKey(feature.getID());
+    }
+    
+    public void addFeature(WebServiceFeature feature) {
+        //TODO NLS enable.
+        if (!isValid(feature))
+            throw ExceptionFactory.makeWebServiceException("Invalid or unsupported WebServiceFeature " + feature.getID());
+        
+        featureMap.put(feature.getID(), feature);
+    }
+    
+    public WebServiceFeature getFeature(String id) {
+        return featureMap.get(id);
+    }
+    
+    public WebServiceFeature[] getAllFeatures() {
+        return featureMap.values().toArray(ZERO_LENGTH_ARRAY);
     }
     
     public void configure(MessageContext messageContext, BindingProvider provider) {

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java Mon Sep 10 06:01:25 2007
@@ -223,6 +223,8 @@
         QName portName = endpointDesc.getPortQName();
         URL wsdlURL = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation();
         
+        //TODO: Need to understand how the binding can influence the behaviour of this method.
+        
         org.apache.axis2.addressing.EndpointReference axis2EPR =
         	new EndpointReferenceBuilder().createEndpointReference(address, serviceName, portName, wsdlURL.toString(), addressingNamespace);
         

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java Mon Sep 10 06:01:25 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.description;
 
+import java.lang.annotation.Annotation;
+
 import javax.jws.WebService;
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Service;
@@ -52,4 +54,6 @@
     public ServiceMode getAnnoServiceMode();
 
     public Service.Mode getAnnoServiceModeValue();
+    
+    public Annotation getAnnoFeature(String id);
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Mon Sep 10 06:01:25 2007
@@ -19,6 +19,7 @@
 package org.apache.axis2.jaxws.description.impl;
 
 import java.io.InputStream;
+import java.lang.annotation.Annotation;
 import java.security.PrivilegedAction;
 import java.util.Iterator;
 import java.util.List;
@@ -37,11 +38,15 @@
 import javax.wsdl.extensions.soap12.SOAP12Binding;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingType;
+import javax.xml.ws.RespectBindingFeature;
 import javax.xml.ws.Service;
 import javax.xml.ws.ServiceMode;
 import javax.xml.ws.WebServiceProvider;
 import javax.xml.ws.handler.PortInfo;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
 import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.client.ServiceClient;
@@ -56,6 +61,7 @@
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.java.security.AccessController;
 import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
 import org.apache.axis2.jaxws.description.EndpointDescriptionWSDL;
@@ -66,7 +72,12 @@
 import org.apache.axis2.jaxws.description.builder.MDQConstants;
 import org.apache.axis2.jaxws.description.builder.WsdlComposite;
 import org.apache.axis2.jaxws.description.xml.handler.HandlerChainsType;
+import org.apache.axis2.jaxws.feature.ServerConfigurator;
+import org.apache.axis2.jaxws.feature.ServerFramework;
 import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.server.config.AddressingConfigurator;
+import org.apache.axis2.jaxws.server.config.MTOMConfigurator;
+import org.apache.axis2.jaxws.server.config.RespectBindingConfigurator;
 import org.apache.axis2.jaxws.util.ClassLoaderUtils;
 import org.apache.axis2.jaxws.util.WSDL4JWrapper;
 import org.apache.axis2.jaxws.util.WSDLWrapper;
@@ -82,6 +93,12 @@
  */
 class EndpointDescriptionImpl
         implements EndpointDescription, EndpointDescriptionJava, EndpointDescriptionWSDL {
+	private static final ServerConfigurator RESPECT_BINDING_CONFIGURATOR =
+        new RespectBindingConfigurator();
+	private static final ServerConfigurator ADDRESSING_CONFIGURATOR =
+        new AddressingConfigurator();
+	private static final ServerConfigurator MTOM_CONFIGURATOR =
+        new MTOMConfigurator();
 
     private ServiceDescriptionImpl parentServiceDescription;
     private AxisService axisService;
@@ -167,6 +184,10 @@
     public static final String BindingType_DEFAULT =
             javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING;
 
+    // Supports WebServiceFeatureAnnotations
+    private ServerFramework framework = new ServerFramework();
+
+    
     /**
      * Create an EndpointDescription based on the WSDL port.  Note that per the JAX-WS Spec (Final
      * Release, 4/19/2006 Section 4.2.3 Proxies, page 55)the "namespace component of the port is the
@@ -431,6 +452,8 @@
         addToAxisService();
 
         buildEndpointDescriptionFromAnnotations();
+        
+        configureWebServiceFeatures();
 
         // The anonymous AxisOperations are currently NOT added here.  The reason 
         // is that (for now) this is a SERVER-SIDE code path, and the anonymous operations
@@ -1320,6 +1343,38 @@
 
         return handlerChainAnnotation;
     }
+
+    // Get the specified WebServiceFeatureAnnotation
+    public Annotation getAnnoFeature(String id) {
+        return framework.getAnnotation(id);
+    }
+    
+    //The WebServiceFeatures should be configued last so that any other
+    //configuration can be overridden. Should only be called on the
+    //server side.
+    private void configureWebServiceFeatures() {
+    	framework.addConfigurator(RespectBindingFeature.ID, RESPECT_BINDING_CONFIGURATOR);
+    	
+    	String binding = getBindingType();
+    	
+    	if (isSOAPBinding(binding)) {
+    		framework.addConfigurator(AddressingFeature.ID, ADDRESSING_CONFIGURATOR);
+    		framework.addConfigurator(SubmissionAddressingFeature.ID, ADDRESSING_CONFIGURATOR);
+    		framework.addConfigurator(MTOMFeature.ID, MTOM_CONFIGURATOR);
+    	}
+    	
+    	//TODO: Need to add support for the DescriptionBuilderComposite?
+    	Annotation[] annotations = implOrSEIClass.getAnnotations();
+    	
+    	if (annotations != null) {
+    		for (Annotation annotation : annotations) {
+    			if (annotation.annotationType().isAnnotationPresent(WebServiceFeatureAnnotation.class))
+    				framework.addAnnotation(annotation);
+    		}
+        	
+        	framework.configure(this);
+    	}
+    }
     
     private Definition getWSDLDefinition() {
         return ((ServiceDescriptionWSDL)getServiceDescription()).getWSDLDefinition();
@@ -1418,6 +1473,16 @@
             throw ExceptionFactory.makeWebServiceException(
                     Messages.getMessage("addPortErr0", getPortQName().toString()));
         }
+    }
+    
+    public static boolean isSOAPBinding(String url) {
+        if (url != null && (url.equals(SOAPBinding.SOAP11HTTP_BINDING) ||
+                url.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) ||
+                url.equals(SOAPBinding.SOAP12HTTP_BINDING)|| 
+                url.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))) {
+            return true;
+        }
+        return false;
     }
 
     private boolean validateClientBindingID(String bindingId) {

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java?rev=574230&r1=574229&r2=574230&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java Mon Sep 10 06:01:25 2007
@@ -18,35 +18,66 @@
  */
 package org.apache.axis2.jaxws.feature;
 
+import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 
-import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
 
+import java.lang.annotation.Annotation;
 import java.util.IdentityHashMap;
 import java.util.Map;
 
-public class ServerFramework extends ConfigFramework {
+public class ServerFramework {
+    private static final Annotation[] ZERO_LENGTH_ARRAY = new Annotation[0];
+
     private Map<String, ServerConfigurator> configuratorMap;
+    private Map<String, Annotation> annotationMap;
     
     public ServerFramework() {
     	super();
         configuratorMap = new IdentityHashMap<String, ServerConfigurator>();
+        annotationMap = new IdentityHashMap<String, Annotation>();
     }
     
     public void addConfigurator(String id, ServerConfigurator configurator) {
         configuratorMap.put(id, configurator);
     }
     
-    public boolean isValid(WebServiceFeature feature) {
-        if (feature == null)
+    public boolean isValid(Annotation annotation) {
+        if (annotation == null)
             return false;
         
-        return configuratorMap.containsKey(feature.getID());
+        WebServiceFeatureAnnotation wsfAnnotation =
+        	annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+        
+        return configuratorMap.containsKey(wsfAnnotation != null ? wsfAnnotation.id() : null);
+    }
+    
+    public void addAnnotation(Annotation annotation) {
+        //TODO NLS enable.
+        if (!isValid(annotation))
+            throw ExceptionFactory.makeWebServiceException("Invalid or unsupported WebServiceFeature annotation, " + annotation);
+        
+        WebServiceFeatureAnnotation wsfAnnotation =
+        	annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+
+        annotationMap.put(wsfAnnotation.id(), annotation);
+    }
+    
+    public Annotation getAnnotation(String id) {
+        return annotationMap.get(id);
+    }
+    
+    public Annotation[] getAllAnnotations() {
+        return annotationMap.values().toArray(ZERO_LENGTH_ARRAY);
     }
     
     public void configure(EndpointDescription endpointDescription) {
-        for (WebServiceFeature feature : getAllFeatures()) {
-            ServerConfigurator configurator = configuratorMap.get(feature.getID());
+        for (Annotation annotation : getAllAnnotations()) {
+            WebServiceFeatureAnnotation wsfAnnotation =
+            	annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+            
+            ServerConfigurator configurator = configuratorMap.get(wsfAnnotation.id());
             configurator.configure(endpointDescription);
         }
     }

Added: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,136 @@
+/*
+ * 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.server.config;
+
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressing;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.ServerConfigurator;
+
+/**
+ *
+ */
+public class AddressingConfigurator implements ServerConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.WebServiceFeatureConfigurator#configure(org.apache.axis2.jaxws.description.EndpointDescription)
+     */
+    public void configure(EndpointDescription endpointDescription) {
+    	Addressing addressing =
+    		(Addressing) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(AddressingFeature.ID);
+    	SubmissionAddressing submissionAddressing =
+    		(SubmissionAddressing) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(SubmissionAddressingFeature.ID);
+    	AxisService service = endpointDescription.getAxisService();
+    	Parameter namespace = new Parameter("addressingNamespace", null);
+    	Parameter disable = new Parameter("disableAddressingHandlers", Boolean.FALSE);
+    	String addressingRequired = AddressingConstants.ADDRESSING_UNSPECIFIED;
+    	
+    	if (addressing != null && submissionAddressing != null) {
+            //Both annotations must have been specified.
+            boolean w3cAddressingEnabled = addressing.enabled();
+            boolean submissionAddressingEnabled = submissionAddressing.enabled();
+            
+            if (w3cAddressingEnabled && submissionAddressingEnabled) {
+            	namespace.setValue(null);
+
+                boolean w3cAddressingRequired = addressing.required();
+                boolean submissionAddressingRequired = submissionAddressing.required();
+
+                if (w3cAddressingRequired && submissionAddressingRequired)
+                	addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
+                else if (w3cAddressingRequired || submissionAddressingRequired)
+                	throw ExceptionFactory.makeWebServiceException("Illegal configuration.");
+            }
+            else if (w3cAddressingEnabled) {
+            	namespace.setValue(AddressingConstants.Final.WSA_NAMESPACE);
+            	
+            	if (addressing.required())
+            		addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
+            }
+            else if (submissionAddressingEnabled) {
+            	namespace.setValue(AddressingConstants.Submission.WSA_NAMESPACE);
+            	
+            	if (submissionAddressing.required())
+            		addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
+            }
+            else {
+            	disable.setValue(Boolean.TRUE);
+            }
+    	}
+    	else if (addressing != null) {
+            //The Addressing annotation must have been specified.
+            boolean w3cAddressingEnabled = addressing.enabled();
+
+            if (w3cAddressingEnabled) {
+            	namespace.setValue(AddressingConstants.Final.WSA_NAMESPACE);
+            	
+            	if (addressing.required())
+            		addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
+            }
+            else {
+            	namespace.setValue(AddressingConstants.Submission.WSA_NAMESPACE);
+            }
+    	}
+    	else if (submissionAddressing != null) {
+            //The SubmissionAddressing annotation must have been specified.
+            boolean submissionAddressingEnabled = submissionAddressing.enabled();
+
+            if (submissionAddressingEnabled) {
+            	namespace.setValue(AddressingConstants.Submission.WSA_NAMESPACE);
+            	
+            	if (submissionAddressing.required())
+            		addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
+            }
+            else {
+            	namespace.setValue(AddressingConstants.Final.WSA_NAMESPACE);
+            }                		
+    	}
+    	else {
+            //If neither were specified then this configurator should never run.
+            throw ExceptionFactory.makeWebServiceException("Both WS-Addressing annotations were unspecified.");
+    	}
+    	
+    	try {
+    		service.addParameter(namespace);
+    		service.addParameter(disable);
+    		service.setWSAddressingFlag(addressingRequired);
+            
+            ServiceDescription sd = endpointDescription.getServiceDescription();
+            AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
+            if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING))
+                axisConfig.engageModule(Constants.MODULE_ADDRESSING);
+    	}
+    	catch (Exception e) {
+            //TODO NLS enable.
+            throw ExceptionFactory.makeWebServiceException("Unable to engage the addressing module.", e);    		
+    	}
+    }
+}

Added: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,65 @@
+/*
+ * 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.server.config;
+
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
+import org.apache.axis2.jaxws.feature.ServerConfigurator;
+
+/**
+ *
+ */
+public class MTOMConfigurator implements ServerConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.WebServiceFeatureConfigurator#configure(org.apache.axis2.jaxws.description.EndpointDescription)
+     */
+    public void configure(EndpointDescription endpointDescription) {
+    	MTOM mtomAnnoation =
+    		(MTOM) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(MTOMFeature.ID);
+    	AxisService service = endpointDescription.getAxisService();
+    	
+    	//Disable MTOM
+    	Parameter enableMTOM = new Parameter("enableMTOM", Boolean.FALSE);
+
+//      TODO NLS enable.
+        if (mtomAnnoation == null)
+            throw ExceptionFactory.makeWebServiceException("The MTOM annotation was unspecified.");
+    	
+        //Enable MTOM.
+    	if (mtomAnnoation.enabled()) {
+        	enableMTOM.setValue(Boolean.TRUE);
+    	}
+    	
+    	try {
+    		service.addParameter(enableMTOM);
+    	}
+    	catch (Exception e) {
+            //TODO NLS enable.
+            throw ExceptionFactory.makeWebServiceException("Unable to enable MTOM.", e);    		
+    	}
+    }    
+}

Added: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java?rev=574230&view=auto
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java Mon Sep 10 06:01:25 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.server.config;
+
+import javax.xml.ws.RespectBinding;
+import javax.xml.ws.RespectBindingFeature;
+
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
+import org.apache.axis2.jaxws.feature.ServerConfigurator;
+
+/**
+ *
+ */
+public class RespectBindingConfigurator implements ServerConfigurator {
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.axis2.jaxws.feature.WebServiceFeatureConfigurator#configure(org.apache.axis2.jaxws.description.EndpointDescription)
+     */
+    public void configure(EndpointDescription endpointDescription) {
+    	RespectBinding mtomAnnoation =
+    		(RespectBinding) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(RespectBindingFeature.ID);
+    	AxisService service = endpointDescription.getAxisService();
+    }
+}



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