axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r503997 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: client/ServiceClient.java deployment/ServiceBuilder.java engine/AxisConfiguration.java util/PolicyUtil.java
Date Tue, 06 Feb 2007 05:51:12 GMT
Author: sanka
Date: Mon Feb  5 21:51:11 2007
New Revision: 503997

URL: http://svn.apache.org/viewvc?view=rev&rev=503997
Log:
1) Fixed the following issue.

If a module add control operations to service at the time of engagement, the WSDL 1.1 generation
fails even if all 
the operations are associated to RPCMessageReceivers.

2) Added method to PolicyUtil to generate a meaningful Id for Polices using service description.

3) Added method to ServiceClient which allows set a new AxisService that represent the service
that client wishes 
to interact. It method is useful when the user wishes to configure a ServiceClient using a
third party Util. For 
instance user may wish to configure a ServiceClient using something like MetadataExchageClientUtil.



Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?view=diff&rev=503997&r1=503996&r2=503997
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Mon Feb  5 21:51:11 2007
@@ -683,4 +683,30 @@
             configContext.terminate();
         }
     }
+    
+    /**
+     * Configure the ServiceClient to interact with the Web service described by
+     * the specified AxisService object.
+     * 
+     * @param axisService the AxisService that represents the new Web service.
+     * @throws AxisFault if an error occurs while configuring the ServiceClient. 
+     */
+    public void setAxisService(AxisService axisService) throws AxisFault{
+        
+        if (axisService == null) {
+            // AxisFault?
+            throw new IllegalArgumentException("AxisService is null");            
+        }
+        
+        axisConfig.removeService(this.axisService.getName());
+        this.axisService = axisService;
+        
+        axisService.setClientSide(true);
+        axisConfig.addService(axisService);
+        
+        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) axisService.getParent();
+        ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configContext,
axisServiceGroup);
+        
+        this.serviceContext = serviceGroupContext.getServiceContext(this.axisService);  
    
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=503997&r1=503996&r2=503997
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Mon Feb  5 21:51:11 2007
@@ -375,6 +375,11 @@
             while (operatins.hasNext()) {
                 AxisOperation axisOperation = (AxisOperation) operatins
                         .next();
+                
+                if (axisOperation.isControlOperation()) {
+                    continue;
+                }
+                
                 if (axisOperation.getMessageReceiver() == null) {
                     continue;
                 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?view=diff&rev=503997&r1=503996&r2=503997
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
Mon Feb  5 21:51:11 2007
@@ -271,6 +271,9 @@
                 while (operatins.hasNext()) {
                     AxisOperation axisOperation = (AxisOperation) operatins
                             .next();
+                    
+                    if (axisOperation.isControlOperation()) { continue; }
+                    
                     if (axisOperation.getMessageReceiver() == null) {
                         axisService.setWsdlFound(false);
                         return;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java?view=diff&rev=503997&r1=503996&r2=503997
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
Mon Feb  5 21:51:11 2007
@@ -17,6 +17,12 @@
 package org.apache.axis2.util;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axis2.description.AxisDescription;
+import org.apache.axis2.description.AxisMessage;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.PolicyInclude;
 import org.apache.neethi.Constants;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
@@ -155,5 +161,34 @@
         writer.flush();
 
         return baos.toString();
+    }
+    
+    public static String generateId(AxisDescription description) {
+        PolicyInclude policyInclude = description.getPolicyInclude();
+        String identifier = "-policy-1";
+        
+        if (description instanceof AxisMessage) {
+            identifier = "msg-" + ((AxisMessage) description).getName() + identifier;
+            description = description.getParent();
+        } 
+        
+        if (description instanceof AxisOperation) {
+            identifier = "op-" + ((AxisOperation) description).getName() + identifier;
+            description = description.getParent();     
+        }  
+        
+        if (description instanceof AxisService) {
+            identifier = "service-" + ((AxisService) description).getName() + identifier;
+        }
+        
+        /*
+         *  Int 49 is the value of the Character '1'. Here we want to change '1' to '2' or
+         *  '2' to '3' .. etc. to construct a unique identifier.
+         */
+        for (int index = 49; policyInclude.getPolicy(identifier) != null; index++) {
+            identifier = identifier.replace((char) index, (char) (index + 1));          
 
+        }
+        
+        return identifier;
     }
 }



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


Mime
View raw message