cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r437587 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
Date Mon, 28 Aug 2006 07:27:05 GMT
Author: tli
Date: Mon Aug 28 00:27:03 2006
New Revision: 437587

URL: http://svn.apache.org/viewvc?rev=437587&view=rev
Log:
fix minor issues

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java?rev=437587&r1=437586&r2=437587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapBindingInfo.java
Mon Aug 28 00:27:03 2006
@@ -8,7 +8,9 @@
 
 public class SoapBindingInfo extends BindingInfo {
     private SoapVersion soapVersion;
+
     private String style;
+
     private String transportURI;
 
     public SoapBindingInfo(ServiceInfo serv, String n, SoapVersion soapVersion) {
@@ -30,7 +32,12 @@
     }
 
     public String getStyle(OperationInfo operation) {
-        return style;
+        SoapOperationInfo opInfo = getOperation(operation.getName()).getExtensor(SoapOperationInfo.class);
+        if (opInfo != null) {
+            return opInfo.getStyle();
+        } else {
+            return style;
+        }
     }
 
     public OperationInfo getOperationByAction(String action) {
@@ -52,13 +59,13 @@
      * @return
      */
     public String getSoapAction(OperationInfo operation) {
-        BindingOperationInfo b = (BindingOperationInfo)getOperation(operation.getName());
+        BindingOperationInfo b = (BindingOperationInfo) getOperation(operation.getName());
         SoapOperationInfo opInfo = b.getExtensor(SoapOperationInfo.class);
 
         if (opInfo != null && opInfo.getAction() != null) {
             return opInfo.getAction();
         }
-        
+
         return "";
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java?rev=437587&r1=437586&r2=437587&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
Mon Aug 28 00:27:03 2006
@@ -28,13 +28,14 @@
 public final class EndpointInvocationHandler extends BindingProviderImpl implements InvocationHandler
{
 
     private static final Logger LOG = LogUtils.getL7dLogger(EndpointInvocationHandler.class);
+
     // private static final ResourceBundle BUNDLE = LOG.getResourceBundle();
 
     private Endpoint endpoint;
+
     private Client client;
 
-    private Map<Method, BindingOperationInfo> infoMap
-        = new ConcurrentHashMap<Method, BindingOperationInfo>();
+    private Map<Method, BindingOperationInfo> infoMap = new ConcurrentHashMap<Method,
BindingOperationInfo>();
 
     EndpointInvocationHandler(Client c, Binding b) {
         super(b);
@@ -49,7 +50,7 @@
         BindingOperationInfo oi = getOperationInfo(proxy, method);
 
         // REVISIT - Holder objects, etc...
-        
+
         Object[] params = args;
         if (null == params) {
             params = new Object[0];
@@ -78,44 +79,41 @@
             }
 
             InterfaceInfo ii = endpoint.getService().getServiceInfo().getInterface();
-   
-            OperationInfo oi = ii.getOperation(new QName(endpoint.getService().getName().getNamespaceURI(),
-                                                         operationName));
+            QName oiQName = new QName(endpoint.getService().getName().getNamespaceURI(),
operationName);
+            OperationInfo oi = ii.getOperation(oiQName);
             if (null == oi) {
                 Message msg = new Message("NO_OPERATION_INFO", LOG, operationName);
                 throw new WebServiceException(msg.toString());
             }
-            //found the OI in the Interface, now find it in the binding
-            for (BindingOperationInfo boi2 : endpoint.getEndpointInfo().getBinding().getOperations())
{
-                if (boi2.getOperationInfo() == oi) {
-                    if (boi2.isUnwrappedCapable()) {
-                        try {
-                            Class requestWrapper = getRequestWrapper(method);
-                            Class responseWrapper = getResponseWrapper(method);
-                            
-                            if (requestWrapper != null || responseWrapper != null) {
-                                BindingOperationInfo boi3 = boi2.getUnwrappedOperation();
-                                oi = boi3.getOperationInfo();
-                                oi.setProperty(WrapperClassOutInterceptor.SINGLE_WRAPPED_PART,
-                                               requestWrapper);
-                                boi2.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART,
-                                                                    Boolean.TRUE);
-                                infoMap.put(method, boi3);
-                                return boi3;
-                            }
-                        } catch (ClassNotFoundException cnfe) {
-                            cnfe.printStackTrace();
-                            //TODO - exception
+            // found the OI in the Interface, now find it in the binding
+            BindingOperationInfo boi2 = endpoint.getEndpointInfo().getBinding().getOperation(oiQName);
+            if (boi2.getOperationInfo() == oi) {
+                if (boi2.isUnwrappedCapable()) {
+                    try {
+                        Class requestWrapper = getRequestWrapper(method);
+                        Class responseWrapper = getResponseWrapper(method);
+
+                        if (requestWrapper != null || responseWrapper != null) {
+                            BindingOperationInfo boi3 = boi2.getUnwrappedOperation();
+                            oi = boi3.getOperationInfo();
+                            oi.setProperty(WrapperClassOutInterceptor.SINGLE_WRAPPED_PART,
requestWrapper);
+                            boi2.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART,
+                                            Boolean.TRUE);
+                            infoMap.put(method, boi3);
+                            return boi3;
                         }
+                    } catch (ClassNotFoundException cnfe) {
+                        cnfe.printStackTrace();
+                        // TODO - exception
                     }
-                    infoMap.put(method, boi2);
-                    return boi2;
                 }
+                infoMap.put(method, boi2);
+                return boi2;
             }
         }
         return boi;
     }
-    
+
     protected Class getResponseWrapper(Method selected) throws ClassNotFoundException {
         ResponseWrapper rw = selected.getAnnotation(ResponseWrapper.class);
         if (rw == null) {
@@ -124,6 +122,7 @@
         String cn = rw.className();
         return ClassLoaderUtils.loadClass(cn, selected.getDeclaringClass());
     }
+
     protected Class getRequestWrapper(Method selected) throws ClassNotFoundException {
         RequestWrapper rw = selected.getAnnotation(RequestWrapper.class);
         if (rw == null) {
@@ -132,6 +131,5 @@
         String cn = rw.className();
         return ClassLoaderUtils.loadClass(cn, selected.getDeclaringClass());
     }
-
 
 }



Mime
View raw message