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/06/19 12:25:27 UTC

svn commit: r548681 - in /webservices/axis2/branches/java/jaxws21/modules: jaxws-api/src/javax/xml/ws/wsaddressing/ jaxws/src/org/apache/axis2/jaxws/ jaxws/src/org/apache/axis2/jaxws/addressing/ jaxws/src/org/apache/axis2/jaxws/addressing/factory/ jaxw...

Author: pradine
Date: Tue Jun 19 03:25:20 2007
New Revision: 548681

URL: http://svn.apache.org/viewvc?view=rev&rev=548681
Log:
Add an EndpointReferenceFactory.

Added:
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactory.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactoryImpl.java
Modified:
    webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.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/registry/FactoryRegistry.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverterTests.java

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java Tue Jun 19 03:25:20 2007
@@ -110,6 +110,7 @@
             otherAttributes.putAll(w3cEPR.otherAttributes);
         }
         catch (Exception e) {
+            //TODO NLS enable.
             throw new WebServiceException("Unable to create W3C endpoint reference.", e);
         }
     }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java Tue Jun 19 03:25:20 2007
@@ -19,11 +19,9 @@
 package org.apache.axis2.jaxws;
 
 import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.addressing.AddressingConstants.Final;
-import org.apache.axis2.addressing.AddressingConstants.Submission;
 import org.apache.axis2.addressing.metadata.ServiceName;
 import org.apache.axis2.addressing.metadata.WSDLLocation;
-import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactory;
 import org.apache.axis2.jaxws.addressing.util.EndpointReferenceConverter;
 import org.apache.axis2.jaxws.binding.BindingUtils;
 import org.apache.axis2.jaxws.binding.SOAPBinding;
@@ -35,6 +33,7 @@
 import org.apache.axis2.jaxws.feature.WebServiceFeatureValidator;
 import org.apache.axis2.jaxws.handler.HandlerResolverImpl;
 import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.axis2.jaxws.spi.ServiceDelegate;
 import org.apache.axis2.transport.http.HTTPConstants;
 
@@ -67,6 +66,9 @@
     protected String addressingNamespace;
 
     private Binding binding;  // force subclasses to use the lazy getter
+    
+    private EndpointReferenceFactory eprFactory =
+        (EndpointReferenceFactory) FactoryRegistry.getFactory(EndpointReferenceFactory.class);
 
     public BindingProvider(ServiceDelegate svcDelegate,
                            EndpointDescription epDesc,
@@ -226,15 +228,9 @@
     }
 
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
-        //TODO NLS enable.
-        if (!SubmissionEndpointReference.class.isAssignableFrom(clazz) &&
-            !W3CEndpointReference.class.isAssignableFrom(clazz))
-            throw ExceptionFactory.makeWebServiceException("Unrecognized class type " + clazz.getCanonicalName());
-        
         T jaxwsEPR = null;
         String bindingID = endpointDesc.getClientBindingID();
-        String addressingNamespace =
-            SubmissionEndpointReference.class.isAssignableFrom(clazz) ? Submission.WSA_NAMESPACE : Final.WSA_NAMESPACE;
+        String addressingNamespace = eprFactory.getAddressingNamespace(clazz);
         
         if (BindingUtils.isSOAPBinding(bindingID)) {
             try {
@@ -268,7 +264,7 @@
                     this.addressingNamespace = addressingNamespace;                    
                 }
             
-                jaxwsEPR = EndpointReferenceConverter.convertFromAxis2(epr, clazz);
+                jaxwsEPR = clazz.cast(EndpointReferenceConverter.convertFromAxis2(epr, addressingNamespace));
             }
             catch (Exception e) {
                 //TODO NLS enable.

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java Tue Jun 19 03:25:20 2007
@@ -124,7 +124,8 @@
             otherAttributes.putAll(subEPR.otherAttributes);
         }
         catch (Exception e) {
-            throw new WebServiceException("Unable to create W3C endpoint reference.", e);
+            //TODO NLS enable.
+            throw new WebServiceException("Unable to create Submission endpoint reference.", e);
         }        
     }
     

Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactory.java?view=auto&rev=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactory.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactory.java Tue Jun 19 03:25:20 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.addressing.factory;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+
+public interface EndpointReferenceFactory {
+    public EndpointReference createEndpointReference(Source eprInfoset, String addressingNamespace);
+    
+    public String getAddressingNamespace(Class clazz);
+}

Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactoryImpl.java?view=auto&rev=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactoryImpl.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/EndpointReferenceFactoryImpl.java Tue Jun 19 03:25:20 2007
@@ -0,0 +1,68 @@
+/*
+ * 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.addressing.factory;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.apache.axis2.addressing.AddressingConstants.Final;
+import org.apache.axis2.addressing.AddressingConstants.Submission;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+
+public class EndpointReferenceFactoryImpl implements EndpointReferenceFactory {
+    public EndpointReferenceFactoryImpl() {
+        super();
+    }
+    
+    private W3CEndpointReference createW3CEndpointReference(Source eprInfoset) {
+        return new W3CEndpointReference(eprInfoset);
+    }
+    
+    private SubmissionEndpointReference createSubmissionEndpointReference(Source eprInfost) {
+        return new SubmissionEndpointReference(eprInfost);
+    }
+    
+    public EndpointReference createEndpointReference(Source eprInfoset, String addressingNamespace) {
+        EndpointReference endpointReference = null;
+        
+        if (Final.WSA_NAMESPACE.equals(addressingNamespace))
+            endpointReference = createW3CEndpointReference(eprInfoset);
+        else if (Submission.WSA_NAMESPACE.equals(addressingNamespace))
+            endpointReference = createSubmissionEndpointReference(eprInfoset);
+        else //TODO NLS enable.
+            throw ExceptionFactory.makeWebServiceException("Unknown addressing namespace: " + addressingNamespace);
+        
+        return endpointReference;
+    }
+    
+    public String getAddressingNamespace(Class clazz) {
+        String addressingNamespace = null;
+        
+        if (W3CEndpointReference.class.isAssignableFrom(clazz))
+            addressingNamespace = Final.WSA_NAMESPACE;
+        else if (SubmissionEndpointReference.class.isAssignableFrom(clazz))
+            addressingNamespace = Submission.WSA_NAMESPACE;
+        else //TODO NLS enable.
+            throw ExceptionFactory.makeWebServiceException("Unknown class type: " + clazz.getCanonicalName());
+        
+        return addressingNamespace;
+    }
+}

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java Tue Jun 19 03:25:20 2007
@@ -20,9 +20,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.PrivilegedExceptionAction;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -35,17 +32,17 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants.Final;
-import org.apache.axis2.addressing.AddressingConstants.Submission;
 import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactory;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.axis2.util.XMLUtils;
 import org.w3c.dom.Element;
 
 public final class EndpointReferenceConverter {
     
     private static OMFactory omFactory = OMAbstractFactory.getOMFactory();
+    private static EndpointReferenceFactory eprFactory =
+        (EndpointReferenceFactory) FactoryRegistry.getFactory(EndpointReferenceFactory.class);
     
     private EndpointReferenceConverter() {
     }
@@ -56,29 +53,19 @@
      * 
      * @param <T>
      * @param axis2EPR
-     * @param clazz
+     * @param addressingNamespace
      * @return
      * @throws AxisFault
      */
-    public static <T extends EndpointReference> T convertFromAxis2(org.apache.axis2.addressing.EndpointReference axis2EPR, final Class<T> clazz)
-    throws AxisFault, NoSuchMethodException, InstantiationException, InvocationTargetException, IllegalAccessException, Exception {
-        String addressingNamespace =
-            SubmissionEndpointReference.class.isAssignableFrom(clazz) ? Submission.WSA_NAMESPACE : Final.WSA_NAMESPACE;
+    public static EndpointReference convertFromAxis2(org.apache.axis2.addressing.EndpointReference axis2EPR, String addressingNamespace)
+    throws AxisFault, Exception {
         QName qname = new QName(addressingNamespace, "EndpointReference", "wsa");
         OMElement omElement =
             EndpointReferenceHelper.toOM(omFactory, axis2EPR, qname, addressingNamespace);
         Element eprElement = XMLUtils.toDOM(omElement);
         Source eprInfoset = new DOMSource(eprElement);
         
-        Constructor constructor =
-            (Constructor) AccessController.doPrivileged(
-                    new PrivilegedExceptionAction() {
-                        public Object run() throws NoSuchMethodException {
-                            return clazz.getConstructor(Source.class);
-                        }
-                    });
-
-        return clazz.cast(constructor.newInstance(eprInfoset));
+        return eprFactory.createEndpointReference(eprInfoset, addressingNamespace);
     }
     
     /**

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?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- 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 Tue Jun 19 03:25:20 2007
@@ -23,8 +23,6 @@
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 
-import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
 import org.w3c.dom.Element;
 
 import java.security.Principal;
@@ -66,10 +64,6 @@
     }
 
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
-        if (!SubmissionEndpointReference.class.isAssignableFrom(clazz) &&
-                !W3CEndpointReference.class.isAssignableFrom(clazz))
-            throw ExceptionFactory.makeWebServiceException("Unrecognized class type " + clazz.getCanonicalName());
-            
         T jaxwsEPR = null;
         
         

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Tue Jun 19 03:25:20 2007
@@ -17,6 +17,8 @@
 
 package org.apache.axis2.jaxws.registry;
 
+import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactory;
+import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactoryImpl;
 import org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockFactoryImpl;
 import org.apache.axis2.jaxws.message.databinding.impl.OMBlockFactoryImpl;
 import org.apache.axis2.jaxws.message.databinding.impl.SOAPEnvelopeBlockFactoryImpl;
@@ -58,6 +60,7 @@
         table.put(EndpointLifecycleManagerFactory.class, new EndpointLifecycleManagerFactory());
         table.put(ClassFinderFactory.class, new ClassFinderFactory());
         table.put(EndpointDispatcherFactory.class, new EndpointDispatcherFactory());
+        table.put(EndpointReferenceFactory.class, new EndpointReferenceFactoryImpl());
     }
 
     /** FactoryRegistry is currently a static singleton */

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?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- 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 Tue Jun 19 03:25:20 2007
@@ -22,7 +22,6 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
 import org.apache.axis2.jaxws.binding.BindingUtils;
 import org.apache.axis2.jaxws.description.DescriptionFactory;
 import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -208,10 +207,6 @@
 
     @Override
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
-        if (!SubmissionEndpointReference.class.isAssignableFrom(clazz) &&
-                !W3CEndpointReference.class.isAssignableFrom(clazz))
-            throw ExceptionFactory.makeWebServiceException("Unrecognized class type " + clazz.getCanonicalName());
-            
         T jaxwsEPR = null;
         
         

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java Tue Jun 19 03:25:20 2007
@@ -111,7 +111,8 @@
                 }            
             }
             
-            w3cEPR = EndpointReferenceConverter.convertFromAxis2(axis2EPR, W3CEndpointReference.class);
+            w3cEPR =
+                (W3CEndpointReference) EndpointReferenceConverter.convertFromAxis2(axis2EPR, Final.WSA_NAMESPACE);
         }
         catch (Exception e) {
             //TODO NLS enable.
@@ -167,19 +168,14 @@
             Transformer xformer = TransformerFactory.newInstance().newTransformer();
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             xformer.transform(eprInfoset, new StreamResult(baos));
+            
             ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
             OMElement eprElement = (OMElement) XMLUtils.toOM(bais);
             org.apache.axis2.addressing.EndpointReference axis2EPR =
                 new org.apache.axis2.addressing.EndpointReference("");
             String addressingNamespace = EndpointReferenceHelper.fromOM(axis2EPR, eprElement);
-            Class<? extends EndpointReference> clazz = null;
-            
-            if (Submission.WSA_NAMESPACE.equals(addressingNamespace))
-                clazz = SubmissionEndpointReference.class;
-            else
-                clazz = W3CEndpointReference.class;
             
-            jaxwsEPR = EndpointReferenceConverter.convertFromAxis2(axis2EPR, clazz);
+            jaxwsEPR = EndpointReferenceConverter.convertFromAxis2(axis2EPR, addressingNamespace);
         }
         catch (Exception e) {
             //TODO NLS enable.

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverterTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverterTests.java?view=diff&rev=548681&r1=548680&r2=548681
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverterTests.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverterTests.java Tue Jun 19 03:25:20 2007
@@ -91,7 +91,7 @@
         org.apache.axis2.addressing.EndpointReference axis2EPR =
             EndpointReferenceHelper.fromOM(omElement);
         W3CEndpointReference jaxwsEPR =
-            EndpointReferenceConverter.convertFromAxis2(axis2EPR, W3CEndpointReference.class);
+            (W3CEndpointReference) EndpointReferenceConverter.convertFromAxis2(axis2EPR, Final.WSA_NAMESPACE);
         assertXMLEqual(EPR200508, jaxwsEPR.toString());
      
         org.apache.axis2.addressing.EndpointReference axis2Result =
@@ -116,7 +116,7 @@
         assertXMLEqual(EPR200508, eprElement.toString());
 
         W3CEndpointReference jaxwsResult =
-            EndpointReferenceConverter.convertFromAxis2(axis2EPR, W3CEndpointReference.class);
+            (W3CEndpointReference) EndpointReferenceConverter.convertFromAxis2(axis2EPR, Final.WSA_NAMESPACE);
         assertXMLEqual(EPR200508, jaxwsResult.toString());
     }
     
@@ -129,7 +129,7 @@
         org.apache.axis2.addressing.EndpointReference axis2EPR =
             EndpointReferenceHelper.fromOM(omElement);
         SubmissionEndpointReference jaxwsEPR =
-            EndpointReferenceConverter.convertFromAxis2(axis2EPR, SubmissionEndpointReference.class);
+            (SubmissionEndpointReference) EndpointReferenceConverter.convertFromAxis2(axis2EPR, Submission.WSA_NAMESPACE);
         assertXMLEqual(EPR200408, jaxwsEPR.toString());
      
         org.apache.axis2.addressing.EndpointReference axis2Result =
@@ -154,13 +154,13 @@
         assertXMLEqual(EPR200408, eprElement.toString());
 
         SubmissionEndpointReference jaxwsResult =
-            EndpointReferenceConverter.convertFromAxis2(axis2EPR, SubmissionEndpointReference.class);
+            (SubmissionEndpointReference) EndpointReferenceConverter.convertFromAxis2(axis2EPR, Submission.WSA_NAMESPACE);
         assertXMLEqual(EPR200408, jaxwsResult.toString());
     }
     
     public void testFailures() throws Exception {
         try {
-            EndpointReferenceConverter.convertFromAxis2(null, W3CEndpointReference.class);
+            EndpointReferenceConverter.convertFromAxis2(null, Final.WSA_NAMESPACE);
             fail("Expected a failure.");
         }
         catch (Exception e) {
@@ -168,7 +168,7 @@
         }
 
         try {
-            EndpointReferenceConverter.convertFromAxis2(null, SubmissionEndpointReference.class);
+            EndpointReferenceConverter.convertFromAxis2(null, Submission.WSA_NAMESPACE);
             fail("Expected a failure.");
         }
         catch (Exception e) {



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