You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2006/07/03 12:25:25 UTC

svn commit: r418734 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description: AxisService2OM.java WSDL11ToAxisServiceBuilder.java

Author: deepal
Date: Mon Jul  3 03:25:21 2006
New Revision: 418734

URL: http://svn.apache.org/viewvc?rev=418734&view=rev
Log:
fixed 854

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java?rev=418734&r1=418733&r2=418734&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java Mon Jul  3 03:25:21 2006
@@ -1,11 +1,6 @@
 package org.apache.axis2.description;
 
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.util.StAXUtils;
@@ -31,11 +26,7 @@
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
 
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
@@ -136,6 +127,15 @@
                 axisService.getTargetNamespace());
         tns = ele.declareNamespace(axisService.getTargetNamespace(), prefix);
 
+        // adding documentation element
+        //<documentation>&lt;b&gt;NEW!&lt;/b&gt; This method accepts an ISBN string and returns &lt;b&gt;Amazon.co.uk&lt;/b&gt; Sales Rank for that book.</documentation>
+        String servicedescription = axisService.getServiceDescription();
+        if (servicedescription != null && !"".equals(servicedescription)) {
+            OMElement documenentattion = fac.createOMElement("documentation", wsdl);
+            documenentattion.setText(servicedescription);
+            ele.addChild(documenentattion);
+        }
+
         ele.addAttribute("targetNamespace", axisService.getTargetNamespace(),
                 null);
         OMElement wsdlTypes = fac.createOMElement("types", wsdl);
@@ -155,9 +155,9 @@
             if (!Constants.NS_URI_XML.equals(targetNamespace)) {
                 schema.write(writer);
                 String schemaString = writer.toString();
-                if (!"".equals(schemaString)) {                	
+                if (!"".equals(schemaString)) {
                     XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new StringReader(schemaString));
-                    
+
                     StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
                     wsdlTypes.addChild(staxOMBuilder.getDocumentElement());
                 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=418734&r1=418733&r2=418734&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Mon Jul  3 03:25:21 2006
@@ -38,20 +38,20 @@
 
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
- * 
- *  
+ *
+ *
  */
 
 public class WSDL11ToAxisServiceBuilder extends WSDLToAxisServiceBuilder {
@@ -197,6 +197,11 @@
                     }
                 }
             }
+            Element documentationElement = wsdl4jDefinition.getDocumentationElement();
+            if (documentationElement != null) {
+                String serviceDes = documentationElement.getFirstChild().toString();
+                axisService.setServiceDescription(serviceDes);
+            }
             processBinding(binding, wsdl4jDefinition);
             return axisService;
         } catch (WSDLException e) {
@@ -269,7 +274,6 @@
      * Finds a SOAP port given the port map
      *
      * @param ports
-     * @return
      */
     private Port findSOAPPort(Map ports) {
         Port port;
@@ -370,6 +374,7 @@
                             wrappableOperations.contains(wsdl4jOperation)));
         }
     }
+
     /**
      * Copy the component from the operation
      *
@@ -428,11 +433,11 @@
                 // with the Default Action Pattern
                 ArrayList inputActions = axisOperation.getWsamappingList();
                 String action = null;
-                if(inputActions == null || inputActions.size()==0){
-                    action = WSDL11ActionHelper.getActionFromInputElement(dif,wsdl4jPortType, wsdl4jOperation,wsdl4jInputMessage);
+                if (inputActions == null || inputActions.size() == 0) {
+                    action = WSDL11ActionHelper.getActionFromInputElement(dif, wsdl4jPortType, wsdl4jOperation, wsdl4jInputMessage);
                 }
-                if(action!=null){
-                    if(inputActions == null){
+                if (action != null) {
+                    if (inputActions == null) {
                         inputActions = new ArrayList();
                         axisOperation.setWsamappingList(inputActions);
                     }
@@ -459,10 +464,10 @@
                 // Check if the action is already set as we don't want to override it
                 // with the Default Action Pattern
                 String action = axisOperation.getOutputAction();
-                if(action == null){
-                    action = WSDL11ActionHelper.getActionFromOutputElement(dif,wsdl4jPortType, wsdl4jOperation,wsdl4jOutputMessage);
+                if (action == null) {
+                    action = WSDL11ActionHelper.getActionFromOutputElement(dif, wsdl4jPortType, wsdl4jOperation, wsdl4jOutputMessage);
                 }
-                if(action!=null){
+                if (action != null) {
                     axisOperation.setOutputAction(action);
                 }
             }
@@ -484,10 +489,10 @@
                 // Check if the action is already set as we don't want to override it
                 // with the Default Action Pattern
                 String action = axisOperation.getOutputAction();
-                if(action == null){
-                    action = WSDL11ActionHelper.getActionFromInputElement(dif,wsdl4jPortType, wsdl4jOperation,wsdl4jInputMessage);
+                if (action == null) {
+                    action = WSDL11ActionHelper.getActionFromInputElement(dif, wsdl4jPortType, wsdl4jOperation, wsdl4jInputMessage);
                 }
-                if(action!=null){
+                if (action != null) {
                     axisOperation.setOutputAction(action);
                 }
             }
@@ -512,11 +517,11 @@
                 // with the Default Action Pattern
                 ArrayList inputActions = axisOperation.getWsamappingList();
                 String action = null;
-                if(inputActions == null || inputActions.size()==0){
-                    action = WSDL11ActionHelper.getActionFromOutputElement(dif,wsdl4jPortType, wsdl4jOperation,wsdl4jOutputMessage);
+                if (inputActions == null || inputActions.size() == 0) {
+                    action = WSDL11ActionHelper.getActionFromOutputElement(dif, wsdl4jPortType, wsdl4jOperation, wsdl4jOutputMessage);
                 }
-                if(action!=null){
-                    if(inputActions == null){
+                if (action != null) {
+                    if (inputActions == null) {
                         inputActions = new ArrayList();
                         axisOperation.setWsamappingList(inputActions);
                     }
@@ -541,14 +546,14 @@
                 faultyMessge.setName(faultMessage.getQName().getLocalPart());
 
             }
-            
+
             // Check if the action is already set as we don't want to override it
             // with the Default Action Pattern
             String action = axisOperation.getFaultAction(fault.getName());
-            if(action == null){
-                action = WSDL11ActionHelper.getActionFromFaultElement(dif,wsdl4jPortType, wsdl4jOperation,fault);
+            if (action == null) {
+                action = WSDL11ActionHelper.getActionFromFaultElement(dif, wsdl4jPortType, wsdl4jOperation, fault);
             }
-            if(action!=null){
+            if (action != null) {
                 axisOperation.addFaultAction(fault.getName(), action);
             }
             axisOperation.setFaultMessages(faultyMessge);
@@ -595,7 +600,6 @@
      *
      * @param wsdl4jDefinition
      * @param binding
-     * @return
      */
     private Element[] generateWrapperSchema(Definition wsdl4jDefinition,
                                             Binding binding) {
@@ -624,9 +628,7 @@
     /**
      * Create a schema by looking at the port type
      *
-     * @param porttype
      * @param targetNamespaceUri
-     * @param forceWrapping
      * @return null if there is no element
      */
     private Element createSchemaForPorttype(String targetNamespaceUri,



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