geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r726171 - /geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
Date Sat, 13 Dec 2008 05:26:38 GMT
Author: gawor
Date: Fri Dec 12 21:26:38 2008
New Revision: 726171

URL: http://svn.apache.org/viewvc?rev=726171&view=rev
Log:
make Geronimo service-ref extensions work with service-refs without wsdl

Modified:
    geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java

Modified: geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java?rev=726171&r1=726170&r2=726171&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
(original)
+++ geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
Fri Dec 12 21:26:38 2008
@@ -105,6 +105,18 @@
                 // Generic Service class specified. 
                 // Service API requires a service qname so create a dummy one
                 this.serviceQName = new QName("http://noservice", "noservice");
+                
+                if (serviceRefType != null) {
+                    for (GerPortType gerPort : serviceRefType.getPortArray()) {
+                        String portName = gerPort.getPortName().trim();
+                        URL location = getLocation(gerPort);
+                        String credentialsName = getCredentialsName(gerPort);
+                        boolean mtomEnabled = isMTOMEnabled(portName);
+                        EndpointInfo info = new EndpointInfo(location, credentialsName, mtomEnabled);
+                        this.portInfoMap.put(portName, info);
+                    }
+                }
+                
                 return;
             } else {
                 // Generated Service class specified.
@@ -349,6 +361,31 @@
         return null;
     }
     
+    private boolean isMTOMEnabled(String portName) {
+        boolean mtomEnabled = false;
+        PortComponentRefType portRef = getPortComponentRef(portName);
+        if (portRef != null && portRef.isSetEnableMtom()) {
+            mtomEnabled = portRef.getEnableMtom().getBooleanValue();
+        }
+        return mtomEnabled;
+    }
+    
+    private PortComponentRefType getPortComponentRef(String portName) {
+        if (this.portComponentRefMap == null) {
+            return null;
+        }
+        for (Class sei : this.portComponentRefMap.keySet()) {
+            QName seiPortType = JAXWSUtils.getPortType(sei);
+            if (seiPortType == null) {
+                continue;
+            }
+            if (portName.equals(seiPortType.getLocalPart())) {
+                return this.portComponentRefMap.get(sei);
+            }        
+        }
+        return null;
+    }
+    
     private class JarWSDLLocator implements WSDLLocator {
 
         private final List<InputStream> streams = new ArrayList<InputStream>();



Mime
View raw message