geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r290605 - in /geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder: AxisBuilder.java SchemaInfoBuilder.java WSDescriptorParser.java
Date Wed, 21 Sep 2005 02:54:51 GMT
Author: djencks
Date: Tue Sep 20 19:54:46 2005
New Revision: 290605

URL: http://svn.apache.org/viewcvs?rev=290605&view=rev
Log:
Re-enable (?) web-service-address element in openejb plan.  Don't know why it stopped working.
 This should go in M5

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?rev=290605&r1=290604&r2=290605&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Tue Sep 20 19:54:46 2005
@@ -157,11 +157,7 @@
         targetGBean.setAttribute("serviceInfo", serviceInfo);
         JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
         URI location = null;
-        try {
-            location = new URI(serviceDesc.getEndpointURL());
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid webservice endpoint URI", e);
-        }
+        location = portInfo.getContextURI();
         targetGBean.setAttribute("location", location);
         URI wsdlURI = null;
         try {
@@ -304,12 +300,12 @@
 
                 GerPortType gerPort = (GerPortType) portMap.get(portName);
 
-                URL location = gerPort == null? getAddressLocation(port): getLocation(gerPort);
+                URL location = gerPort == null ? getAddressLocation(port) : getLocation(gerPort);
                 //skip non-soap ports
                 if (location == null) {
                     continue;
                 }
-                String credentialsName = gerPort == null || gerPort.getCredentialsName()
== null? null : gerPort.getCredentialsName().trim();
+                String credentialsName = gerPort == null || gerPort.getCredentialsName()
== null ? null : gerPort.getCredentialsName().trim();
 
                 Binding binding = port.getBinding();
 

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?rev=290605&r1=290604&r2=290605&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Tue Sep 20 19:54:46 2005
@@ -567,21 +567,7 @@
         throw new DeploymentException("No element of class " + clazz.getName() + " found");
     }
 
-    public static void updatePortLocations(Service service, Map portLocations) throws DeploymentException
{
-        for (Iterator iterator = portLocations.entrySet().iterator(); iterator.hasNext();)
{
-            Map.Entry entry = (Map.Entry) iterator.next();
-            String portName = (String) entry.getKey();
-            String location = (String) entry.getValue();
-            Port port = service.getPort(portName);
-            if (port == null) {
-                throw new DeploymentException("No port named " + portName + " found in service
" + service.getQName());
-            }
-            SOAPAddress soapAddress = (SOAPAddress) getExtensibilityElement(SOAPAddress.class,
port.getExtensibilityElements());
-            soapAddress.setLocationURI(location);
-        }
-    }
-
-    public void movePortLocation(String portComponentName, String servletLocation) throws
DeploymentException {
+    public String movePortLocation(String portComponentName, String servletLocation) throws
DeploymentException {
         DefinitionsDocument doc = (DefinitionsDocument) wsdlMap.get(uris.get(0));
         TDefinitions definitions = doc.getDefinitions();
         TService[] services = definitions.getServiceArray();
@@ -600,7 +586,7 @@
                                 servletLocation = originalURI.getPath();
                             }
                             portCursor.setAttributeText(LOCATION_QNAME, AxisWebServiceContainer.LOCATION_REPLACEMENT_TOKEN
+ servletLocation);
-                            return;
+                            return servletLocation;
                         }
                     } catch (URISyntaxException e) {
                         throw new DeploymentException("Could not construct URI for ejb location
in wsdl", e);

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?rev=290605&r1=290604&r2=290605&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
Tue Sep 20 19:54:46 2005
@@ -320,7 +320,6 @@
                 seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(),
seiMapping);
             }
 
-//            Map portLocations = new HashMap();
             PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
             for (int j = 0; j < portComponents.length; j++) {
                 PortComponentType portComponent = portComponents[j];
@@ -332,16 +331,18 @@
                     throw new DeploymentException("Wrong kind of web service described in
web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                 }
                 String linkName;
+                String servletLocation;
                 if (serviceImplBeanType.isSetServletLink()) {
                     linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
-                    String servletLocation = (String) servletLocations.get(linkName);
+                    servletLocation = (String) servletLocations.get(linkName);
                     if (servletLocation == null) {
                         throw new DeploymentException("No servlet mapping for port " + portQName);
                     }
                     schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                 } else {
                     linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
-                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), null);
+                    servletLocation = (String) servletLocations.get(linkName);
+                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(),
servletLocation);
                 }
                 PortComponentHandlerType[] handlers = portComponent.getHandlerArray();
 
@@ -353,7 +354,12 @@
                 ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType)
seiMappings.get(seiInterfaceName);
 
                 String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
-                URI contextURI = getAddressLocation(port);
+                URI contextURI = null;
+                try {
+                    contextURI = new URI(servletLocation);
+                } catch (URISyntaxException e) {
+                    throw new DeploymentException("Could not construct URI for web service
location", e);
+                }
 
                 PortInfo portInfo = new PortInfo(portComponentName, portQName, schemaInfoBuilder,
javaWsdlMapping, seiInterfaceName, handlers, port, seiMapping, wsdlLocation, contextURI);
 
@@ -363,18 +369,6 @@
             }
         }
         return portMap;
-    }
-
-    private static URI getAddressLocation(Port port) throws DeploymentException {
-        SOAPAddress soapAddress = (SOAPAddress) SchemaInfoBuilder.getExtensibilityElement(SOAPAddress.class,
port.getExtensibilityElements());
-        String locationURIString = soapAddress.getLocationURI();
-        try {
-            URI location = new URI(locationURIString);
-            URI contextPath = new URI(location.getPath());
-            return contextPath;
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Could not construct web service location URL from
" + locationURIString);
-        }
     }
 
     public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean
isEJB, Map servletLocations) throws DeploymentException {



Mime
View raw message