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 2005/06/30 13:14:03 UTC

svn commit: r202530 - in /webservices/axis/trunk/java/modules/core: src/org/apache/axis/deployment/repository/util/ src/org/apache/axis/description/ src/org/apache/axis/engine/ src/org/apache/axis/transport/http/ webapp/

Author: deepal
Date: Thu Jun 30 04:14:01 2005
New Revision: 202530

URL: http://svn.apache.org/viewcvs?rev=202530&view=rev
Log:
1. ?wsdl completed (but there is a problem with FirFox)
2. Changed MessageContext pause logic in AxisEngine.receive

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/util/ArchiveReader.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java
    webservices/axis/trunk/java/modules/core/webapp/listServices.jsp
    webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/util/ArchiveReader.java?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/util/ArchiveReader.java Thu Jun 30 04:14:01 2005
@@ -210,7 +210,7 @@
                 in = cl.getResourceAsStream("modules/" + moduleName + ".jar");
             }
             if(in == null){
-                throw new DeploymentException( moduleName + " does not found");
+                throw new DeploymentException( moduleName + " module is not found");
             }
             ZipInputStream zin = null;
             zin = new ZipInputStream(in);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java Thu Jun 30 04:14:01 2005
@@ -15,18 +15,15 @@
 */
 package org.apache.axis.description;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
+import java.util.*;
 import java.io.OutputStream;
 import java.io.Writer;
 import java.io.IOException;
 import java.io.StringWriter;
 
 import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.*;
 import javax.wsdl.factory.WSDLFactory;
 import javax.xml.namespace.QName;
 
@@ -41,6 +38,8 @@
 import org.apache.wsdl.extensions.SOAPOperation;
 import org.apache.wsdl.impl.WSDLInterfaceImpl;
 import org.apache.wsdl.impl.WSDLServiceImpl;
+import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
+import com.ibm.wsdl.extensions.soap.SOAPConstants;
 
 /**
  * Class ServiceDescription
@@ -49,7 +48,7 @@
         extends WSDLServiceImpl
         implements WSDLService, ParameterInclude, FlowInclude, DescriptionConstants {
 
-     private Definition difDefinition = null; //to store the wsdl definition , which is build at the deployment time
+    private Definition difDefinition = null; //to store the wsdl definition , which is build at the deployment time
 
 
     /**
@@ -152,7 +151,7 @@
      */
     public OperationDescription getOperation(QName operationName) {
 
-       return (OperationDescription) this.getServiceInterface().getAllOperations().get(operationName.getLocalPart());
+        return (OperationDescription) this.getServiceInterface().getAllOperations().get(operationName.getLocalPart());
     }
 
     /*
@@ -424,13 +423,13 @@
      * @return
      */
     public HashMap getOperations() {
-    	return this.getServiceInterface().getOperations();
+        return this.getServiceInterface().getOperations();
     }
-    
+
     public OperationDescription getOperation(String ncName){
-    	return (OperationDescription)this.getServiceInterface().getOperations().get(ncName);
+        return (OperationDescription)this.getServiceInterface().getOperations().get(ncName);
     }
-    
+
     /**
      * This method will return the operation given particular SOAP Action. 
      * This method should only be called if there is only one Endpoint is defined
@@ -443,18 +442,18 @@
      * otherwise will return null.
      */
     public OperationDescription getOperationBySOAPAction(String soapAction){
-    	Iterator iterator = this.getEndpoints().keySet().iterator();
-    	if(iterator.hasNext()){
-    		WSDLEndpoint endpoint = (WSDLEndpoint)iterator.next();
-    		return this.getOperationBySOAPAction(soapAction, endpoint.getName());
-    	}
-    	
-    	return null;
-		
-		
+        Iterator iterator = this.getEndpoints().keySet().iterator();
+        if(iterator.hasNext()){
+            WSDLEndpoint endpoint = (WSDLEndpoint)iterator.next();
+            return this.getOperationBySOAPAction(soapAction, endpoint.getName());
+        }
+
+        return null;
+
+
     }
-    
-    
+
+
     /**
      * This method will return the operation given the particular endpoing and the 
      * particular SOAP Action. If more than one Operation is found with the given 
@@ -467,30 +466,30 @@
      * otherwise will return null.
      */
     public OperationDescription getOperationBySOAPAction(String soapAction, QName endpoint){
-    	HashMap bindingOperations = this.getEndpoint(endpoint).getBinding().getBindingOperations();
-    	Iterator operationKeySetIterator = bindingOperations.keySet().iterator();
-    	OperationDescription operation = null;
-    	int count = 0;
-    	while(operationKeySetIterator.hasNext()){
-    		WSDLBindingOperation bindingOperation = (WSDLBindingOperation)bindingOperations.get(operationKeySetIterator.next());
-    		Iterator extIterator = bindingOperation.getExtensibilityElements().iterator();
-    		while(extIterator.hasNext()){
-    			ExtensibilityElement element = (ExtensibilityElement)extIterator.next();
-    			if(element.getElementType().equals(ExtensionConstants.SOAP_OPERATION)){
-    				if(((SOAPOperation)element).getSoapAction().equals(soapAction)){
-    					operation = (OperationDescription)bindingOperation.getOperation();
-    					count++;
-    				}
-    			}
-    		}
-    	}
-    	if(1 == count){
-    		return operation;
-    	}
-    	return null;
+        HashMap bindingOperations = this.getEndpoint(endpoint).getBinding().getBindingOperations();
+        Iterator operationKeySetIterator = bindingOperations.keySet().iterator();
+        OperationDescription operation = null;
+        int count = 0;
+        while(operationKeySetIterator.hasNext()){
+            WSDLBindingOperation bindingOperation = (WSDLBindingOperation)bindingOperations.get(operationKeySetIterator.next());
+            Iterator extIterator = bindingOperation.getExtensibilityElements().iterator();
+            while(extIterator.hasNext()){
+                ExtensibilityElement element = (ExtensibilityElement)extIterator.next();
+                if(element.getElementType().equals(ExtensionConstants.SOAP_OPERATION)){
+                    if(((SOAPOperation)element).getSoapAction().equals(soapAction)){
+                        operation = (OperationDescription)bindingOperation.getOperation();
+                        count++;
+                    }
+                }
+            }
+        }
+        if(1 == count){
+            return operation;
+        }
+        return null;
     }
 
-   
+
     /**
      * This finds the ServiceContext provided that the incomming message that
      * has have some serviceInstanceID. Currently this will not be added to the
@@ -540,10 +539,42 @@
         this.difDefinition = difDefinition;
     }
 
-    public void printWSDL(Writer out)throws AxisFault{
+    public void printWSDL(Writer out, String PortURL)throws AxisFault{
         try {
-            WSDLFactory.newInstance().newWSDLWriter().writeWSDL(this.getWSDLDefinition(),out);
-            out.flush();
+            Definition wsdlDefinition = this.getWSDLDefinition();
+            if(wsdlDefinition !=null){
+                wsdlDefinition.removeService(this.getName());
+
+                Service service = wsdlDefinition.createService();
+                service.setQName(this.getName());
+
+                Port port = wsdlDefinition.createPort();
+                SOAPAddress soapAddress = new SOAPAddressImpl();
+                soapAddress.setElementType(SOAPConstants.Q_ELEM_SOAP_ADDRESS);
+                soapAddress.setLocationURI(PortURL);
+                port.addExtensibilityElement(soapAddress);
+                port.setName(this.getName().getLocalPart() + "Port");
+
+                Map bindingsMap = wsdlDefinition.getBindings();
+                Collection bind_col = bindingsMap.values();
+                for (Iterator iterator = bind_col.iterator(); iterator.hasNext();) {
+                    Binding binding = (Binding) iterator.next();
+                    port.setBinding(binding);
+                    break;
+                }
+                service.addPort(port);
+
+                wsdlDefinition.addService(service);
+                WSDLFactory.newInstance().newWSDLWriter().writeWSDL(wsdlDefinition,out);
+                out.flush();
+            }   else {
+                WSDLFactory.newInstance().newWSDLWriter().writeWSDL(wsdlDefinition,out);
+                out.write("<wsdl>WSDL is NOT found</wsdl>");
+                out.flush();
+            }
+
+
+
         } catch (WSDLException e) {
             throw new AxisFault(e);
         } catch (IOException e) {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Thu Jun 30 04:14:01 2005
@@ -114,12 +114,14 @@
             OperationContext operationContext = msgContext.getOperationContext();
             OperationDescription operationDescription = operationContext.getAxisOperation();
             phases = operationDescription.getRemainingPhasesInFlow();
+
             if (paused) {
                 resumeInvocationPhases(phases, msgContext);
             } else {
                 invokePhases(phases, msgContext);
             }
-            if (msgContext.isServerSide()) {
+            paused = msgContext.isPaused();
+            if (msgContext.isServerSide() && !paused) {
                 // add invoke Phase
                 MessageReceiver reciver = operationDescription.getMessageReciever();
                 reciver.recieve(msgContext);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java Thu Jun 30 04:14:01 2005
@@ -379,12 +379,12 @@
             if (serviceObj != null) {
                 if(wsdl != null){
                     StringWriter writer = new StringWriter();
-                    ((ServiceDescription)serviceObj).printWSDL(writer);
-                    String wsdl_value = writer.toString() ;
+                    ((ServiceDescription)serviceObj).printWSDL(writer,filePart);
+                    String wsdl_value = writer.toString().trim() ;
                     if(wsdl_value == null || wsdl_value.trim().equals("")){
                         wsdl_value = "WSDL is not available!!!";
-                    }
-                    res.setContentType("text/xml");
+                    } 
+                    res.setContentType("xml");
                     req.getSession().setAttribute(Constants.WSDL_CONTENT, wsdl_value);
                 }   else {
                     req.getSession().setAttribute(Constants.SINGLE_SERVICE, serviceObj);

Modified: webservices/axis/trunk/java/modules/core/webapp/listServices.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/listServices.jsp?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/listServices.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/listServices.jsp Thu Jun 30 04:14:01 2005
@@ -47,7 +47,7 @@
             operations = axisService.getOperations();
             operationsList = operations.values();
             serviceName = axisService.getName().getLocalPart();
-            %><hr><h2><font color="blue"><a href="<%=prifix + axisService.getName().getLocalPart()%>?wsdl=<%=serviceName%>"></a><%=serviceName%></font></h2>
+            %><hr><h2><font color="blue"><a href="<%=prifix + axisService.getName().getLocalPart()%>?wsdl=<%=serviceName%>"><%=serviceName%></a></font></h2>
             <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
            <%
             if (operationsList.size() > 0) {

Modified: webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp Thu Jun 30 04:14:01 2005
@@ -8,26 +8,12 @@
                  javax.xml.namespace.QName,
                  java.io.StringWriter,
                  java.io.PrintWriter"%>
- <%--
-  Created by IntelliJ IDEA.
-  User: Ajith
-  Date: Feb 17, 2005
-  Time: 8:47:13 PM
-  To change this template use File | Settings | File Templates.
---%>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%--        <jsp:include page="include/header.inc"></jsp:include>--%>
-
-        <%
-            ServiceDescription service = (ServiceDescription)request.getSession().getAttribute(Constants.SINGLE_SERVICE);
-            String wsdl_value = (String)request.getSession().getAttribute(Constants.WSDL_CONTENT);
-            //System.out.println("service = " + service);
-            String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
-            String wsdl = request.getParameter("wsdl");
-            boolean isWsdl = false;
-            if(wsdl_value!=null){
-                %>
-                <%=wsdl_value%>
+<%@ page contentType="text/xml;charset=UTF-8" language="java" %>
+<%
+String wsdl_value = (String)request.getSession().getAttribute(Constants.WSDL_CONTENT);
+String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
+if(wsdl_value!=null){%>
+<%=wsdl_value.trim()%>
                 <%
             } else if(Constants.IS_FAULTY.equals(isFault)){
                 Hashtable errornessservices =(Hashtable)request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);