cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r454465 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/service/model/ api/src/test/java/org/apache/cxf/service/model/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindin...
Date Mon, 09 Oct 2006 19:19:19 GMT
Author: dandiep
Date: Mon Oct  9 12:19:18 2006
New Revision: 454465

URL: http://svn.apache.org/viewvc?view=rev&rev=454465
Log:
o Simple WSDL generation now works. However, schemas still aren't generated.
o Add a convenience constructor to WSDLServiceFactor.
o Remove getWSDL11Extensors from the service model as its really only needed
  in the ServiceWSDLBuilder and I'd rather not put the WSDL 2 stuff there too.
o Fix a few bugs with namespaces in service generation.

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBinding.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Mon Oct  9 12:19:18 2006
@@ -126,8 +126,8 @@
             try {
                 Interceptor currentInterceptor = iterator.next();
                
-                if (LOG.isLoggable(Level.FINE)) {
-                    LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor);
+                if (LOG.isLoggable(Level.INFO)) {
+                    LOG.info("Invoking handleMessage on interceptor " + currentInterceptor);
                 }
                 currentInterceptor.handleMessage(message);
             } catch (Exception ex) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java Mon Oct  9 12:19:18 2006
@@ -20,14 +20,11 @@
 package org.apache.cxf.service.model;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicReference;
 
-import javax.wsdl.extensions.ExtensibilityElement;
-
 public abstract class AbstractPropertiesHolder {
     private AtomicReference<Map<String, Object>> propertyMap = new AtomicReference<Map<String, Object>>();
     private AtomicReference<Object[]> extensors = new AtomicReference<Object[]>();
@@ -99,34 +96,8 @@
         return list;
     }
 
-    public List<ExtensibilityElement> getWSDL11Extensors() {
-        if (extensors.get() == null) {
-            return null;
-        }
-        List<ExtensibilityElement> list
-            = new ArrayList<ExtensibilityElement>(extensors.get().length);
-        for (Object obj : extensors.get()) {
-            if (obj instanceof ExtensibilityElement) {
-                list.add((ExtensibilityElement)obj);
-            }
-        }
-        return Collections.unmodifiableList(list);
-    }
-    /*
-    //eventually for wsdl20 support
-    public List<org.apache.woden.wsdl20.extensions.ExtensionElement> getWSDL12Extensors() {
-        if (extensors.get() == null) {
-            return null;
-        }
-        List<ExtensionElement> list
-            = new ArrayList<ExtensionElement>(extensors.get().length);
-        for (Object obj : extensors.get()) {
-            if (obj instanceof ExtensionElement) {
-                list.add((ExtensionElement)obj);
-            }
-        }
-        return Collections.unmodifiableList(list);
+    public AtomicReference<Object[]> getExtensors() {
+        return extensors;
     }
-    */
 
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Mon Oct  9 12:19:18 2006
@@ -27,6 +27,7 @@
     
     private boolean isElement;
     private QName typeName;
+    private QName elementName;
     private boolean isInSoapHeader;
 
     MessagePartInfo(QName n, AbstractMessageContainer info) {
@@ -49,7 +50,7 @@
     
     public QName getConcreteName() {
         if (isElement) {
-            return typeName;
+            return elementName;
         } else {
             return pname;
         }
@@ -63,16 +64,10 @@
     }
     
     public QName getElementQName() {
-        if (isElement) {
-            return typeName; 
-        }
-        return null;
+        return elementName;
     }
     public QName getTypeQName() {
-        if (!isElement) {
-            return typeName; 
-        }
-        return null;
+        return typeName;
     }
     public void setTypeQName(QName qn) {
         isElement = false;
@@ -80,7 +75,7 @@
     }
     public void setElementQName(QName qn) {
         isElement = true;
-        typeName = qn;
+        elementName = qn;
     }
     
     public AbstractMessageContainer getMessageInfo() {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java Mon Oct  9 12:19:18 2006
@@ -21,8 +21,6 @@
 
 import java.util.List;
 
-import javax.wsdl.extensions.ExtensibilityElement;
-
 public class UnwrappedOperationInfo extends OperationInfo {
     OperationInfo wrappedOp;
 
@@ -64,7 +62,4 @@
         return wrappedOp.getExtensors(cls);
     }
 
-    public List<ExtensibilityElement> getWSDL11Extensors() {
-        return wrappedOp.getWSDL11Extensors();
-    }
 }

Modified: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java (original)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java Mon Oct  9 12:19:18 2006
@@ -34,8 +34,6 @@
         messagePartInfo = new MessagePartInfo(new QName(
             "http://apache.org/hello_world_soap_http", "testMessagePart"), null);
         messagePartInfo.setIsElement(true);
-        messagePartInfo.setElementQName(new QName(
-            "http://apache.org/hello_world_soap_http/types", "testElement"));
     }
     
     public void tearDown() throws Exception {
@@ -55,6 +53,8 @@
     }
 
     public void testElement() {
+        messagePartInfo.setElementQName(new QName("http://apache.org/hello_world_soap_http/types",
+                                                  "testElement"));
         assertTrue(messagePartInfo.isElement());
         assertEquals(messagePartInfo.getElementQName().getLocalPart(), "testElement");
         assertEquals(messagePartInfo.getElementQName().getNamespaceURI(),

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java Mon Oct  9 12:19:18 2006
@@ -44,7 +44,7 @@
         if (obj == null) {
             Set<QName> set = new HashSet<QName>();
             List<MessagePartInfo> mps = bmi.getMessageInfo().getMessageParts();
-            for (ExtensibilityElement ext : bmi.getWSDL11Extensors()) {
+            for (ExtensibilityElement ext : bmi.getExtensors(ExtensibilityElement.class)) {
                 if (SOAPBindingUtil.isSOAPHeader(ext)) {
                     SoapHeader header = SOAPBindingUtil.getSoapHeader(ext);
                     String pn = header.getPart();

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Mon Oct  9 12:19:18 2006
@@ -181,7 +181,7 @@
         initializeBindingInfo(service, binding, bi);
 
         org.apache.cxf.tools.common.extensions.soap.SoapBinding wSoapBinding
-            = SOAPBindingUtil.getSoapBinding(bi.getWSDL11Extensors());
+            = SOAPBindingUtil.getSoapBinding(bi.getExtensors(ExtensibilityElement.class));
         
         bi.setTransportURI(wSoapBinding.getTransportURI());
         bi.setStyle(wSoapBinding.getStyle());
@@ -196,7 +196,8 @@
     private void initializeBindingOperation(SoapBindingInfo bi, BindingOperationInfo boi) {
         SoapOperationInfo soi = new SoapOperationInfo();
 
-        SoapOperation soapOp = SOAPBindingUtil.getSoapOperation(boi.getWSDL11Extensors());
+        SoapOperation soapOp = 
+            SOAPBindingUtil.getSoapOperation(boi.getExtensors(ExtensibilityElement.class));
         
         if (soapOp != null) {
             String action = soapOp.getSoapActionURI();
@@ -226,7 +227,8 @@
         List<MessagePartInfo> messageParts = new ArrayList<MessagePartInfo>();
         messageParts.addAll(msg.getMessageParts());
 
-        List<SoapHeader> headers = SOAPBindingUtil.getSoapHeaders(bmsg.getWSDL11Extensors());
+        List<SoapHeader> headers = 
+            SOAPBindingUtil.getSoapHeaders(bmsg.getExtensors(ExtensibilityElement.class));
         if (headers != null) {
             for (SoapHeader header : headers) {
                 SoapHeaderInfo headerInfo = new SoapHeaderInfo();
@@ -245,7 +247,7 @@
         }
 
         SoapBodyInfo bodyInfo = new SoapBodyInfo();
-        SoapBody soapBody = SOAPBindingUtil.getSoapBody(bmsg.getWSDL11Extensors());
+        SoapBody soapBody = SOAPBindingUtil.getSoapBody(bmsg.getExtensors(ExtensibilityElement.class));
         List parts = null;
         if (soapBody == null) {
             MIMEMultipartRelated mmr = bmsg.getExtensor(MIMEMultipartRelated.class);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java Mon Oct  9 12:19:18 2006
@@ -30,12 +30,16 @@
 import javax.wsdl.extensions.soap.SOAPAddress;
 
 import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
+import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
+import com.ibm.wsdl.extensions.soap.SOAPOperationImpl;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
+import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
@@ -91,11 +95,33 @@
     }
 
     public void createPortExtensors(EndpointInfo ei, Service service) {
+        SoapBindingInfo bi = (SoapBindingInfo) ei.getBinding();
+        if (bi.getSoapVersion() instanceof Soap11) {
+            createSoap11Extensors(ei, bi);
+        }
+    }
+
+    private void createSoap11Extensors(EndpointInfo ei, SoapBindingInfo bi) {
         SOAPAddress address = new SOAPAddressImpl();
         address.setLocationURI(ei.getAddress());
-        address.setRequired(Boolean.TRUE);
-
+        
         ei.addExtensor(address);
+        
+        
+        SOAPBindingImpl sbind = new SOAPBindingImpl();
+        sbind.setStyle(bi.getStyle());
+        sbind.setTransportURI(bi.getTransportURI());
+        bi.addExtensor(sbind);
+        
+        for (BindingOperationInfo b : bi.getOperations()) {
+            SoapOperationInfo soi = b.getExtensor(SoapOperationInfo.class);
+            
+            SOAPOperationImpl op = new SOAPOperationImpl();
+            op.setSoapActionURI(soi.getAction());
+            op.setStyle(soi.getStyle());
+            
+            b.addExtensor(op);
+        }
     }
 
     public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port) {

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBinding.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBinding.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBinding.java Mon Oct  9 12:19:18 2006
@@ -18,33 +18,15 @@
  */
 package org.apache.cxf.binding.xml;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.cxf.binding.Binding;
-import org.apache.cxf.binding.xml.interceptor.XMLFaultInInterceptor;
-import org.apache.cxf.binding.xml.interceptor.XMLFaultOutInterceptor;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
-import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.message.XMLMessage;
 
 public class XMLBinding extends AbstractBasicInterceptorProvider implements Binding {
 
-    private List<Interceptor> in;
-    private List<Interceptor> out;
-    private List<Interceptor> fault;
-    private Interceptor outFaultInterceptor;
-    private Interceptor inFaultInterceptor;
-    
     public XMLBinding() {
-        in = new ArrayList<Interceptor>();
-        out = new ArrayList<Interceptor>();
-        fault = new ArrayList<Interceptor>();
-        
-        outFaultInterceptor = new XMLFaultOutInterceptor();
-        inFaultInterceptor = new XMLFaultInInterceptor();
     }
     
     public Message createMessage() {
@@ -54,25 +36,4 @@
     public Message createMessage(Message m) {
         return new XMLMessage(m);
     }
-
-    public List<Interceptor> getFaultInterceptors() {
-        return fault;
-    }
-
-    public List<Interceptor> getInInterceptors() {
-        return in;
-    }
-
-    public List<Interceptor> getOutInterceptors() {
-        return out;
-    }
-
-    public Interceptor getInFaultInterceptor() {
-        return inFaultInterceptor;
-    }
-
-    public Interceptor getOutFaultInterceptor() {
-        return outFaultInterceptor;
-    }
-
 }

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java Mon Oct  9 12:19:18 2006
@@ -77,13 +77,11 @@
         xb.getInInterceptors().add(new XMLMessageInInterceptor());
         
         xb.getInFaultInterceptors().add(new StaxInInterceptor());
-        xb.getInFaultInterceptors().add(xb.getInFaultInterceptor());
         
         xb.getOutInterceptors().add(new StaxOutInterceptor());
         xb.getOutInterceptors().add(new XMLMessageOutInterceptor());
         
         xb.getOutFaultInterceptors().add(new StaxOutInterceptor());
-        xb.getOutFaultInterceptors().add(xb.getOutFaultInterceptor());
 
         return xb;
     }

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptor.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptor.java Mon Oct  9 12:19:18 2006
@@ -90,7 +90,7 @@
     private void writeMessage(Message message, QName name, boolean executeBare) {
         XMLStreamWriter xmlWriter = message.getContent(XMLStreamWriter.class);
         try {
-            StaxUtils.writeStartElement(xmlWriter, "xmlroot", name.getLocalPart(), name.getNamespaceURI());
+            StaxUtils.writeStartElement(xmlWriter, "", name.getLocalPart(), name.getNamespaceURI());
             if (executeBare) {
                 new BareOutInterceptor().handleMessage(message);
             }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java Mon Oct  9 12:19:18 2006
@@ -29,6 +29,8 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
 
 /**
@@ -44,8 +46,10 @@
         final Object serviceObject = getServiceObject(exchange);
 
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
-
-        Method m = (Method)bop.getOperationInfo().getProperty(Method.class.getName());
+        MethodDispatcher md = (MethodDispatcher) 
+            exchange.get(Service.class).get(MethodDispatcher.class.getName());
+        Method m = md.getMethod(bop);
+        //Method m = (Method)bop.getOperationInfo().getProperty(Method.class.getName());
         m = matchMethod(m, serviceObject);
         List<Object> params = CastUtils.cast((List<?>)o);
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java Mon Oct  9 12:19:18 2006
@@ -66,7 +66,12 @@
     public void setUp() throws Exception {
         bus = createBus();
         
-        namespaces.put("s", "http://schemas.xmlsoap.org/soap/envelope/");
+        addNamespace("s", "http://schemas.xmlsoap.org/soap/envelope/");
+        addNamespace("xsd", "http://www.w3.org/2001/XMLSchema");
+        addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
+        addNamespace("wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/");
+        addNamespace("soap", "http://schemas.xmlsoap.org/soap/");
+        
     }
     
     public Bus getBus() {
@@ -99,7 +104,7 @@
             throw new RuntimeException("Could not find resource " + message);
         }
         
-        copy(is, os, 8096);
+        copy(is, os);
 
         byte[] bs = obs.getResponseStream().toByteArray();
         
@@ -111,9 +116,10 @@
                                             + obs.getResponseStream().toString());
         }
     }
-
-    private void copy(final InputStream input, final OutputStream output, final int bufferSize)
+   
+    protected void copy(final InputStream input, final OutputStream output)
         throws IOException {
+        int bufferSize = 1024;
         try {
             final byte[] buffer = new byte[bufferSize];
 
@@ -215,7 +221,7 @@
 
         public void onMessage(Message message) {
             try {
-                copy(message.getContent(InputStream.class), response, 1024);
+                copy(message.getContent(InputStream.class), response);
             } catch (IOException e) {
                 e.printStackTrace();
                 fail();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java Mon Oct  9 12:19:18 2006
@@ -20,7 +20,9 @@
 package org.apache.cxf.wsdl11;
 
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.wsdl.Binding;
 import javax.wsdl.BindingFault;
@@ -48,6 +50,7 @@
 
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.AbstractMessageContainer;
+import org.apache.cxf.service.model.AbstractPropertiesHolder;
 import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingMessageInfo;
@@ -63,20 +66,61 @@
 
 public final class ServiceWSDLBuilder {
     
-    private static ServiceWSDLBuilder serviceWSDLBuilder;       
+    private Map<String, String> prefix2ns;
+    private Map<String, String> ns2prefix;
+    private Definition definition;
+    private ServiceInfo service;
     
-    private ServiceWSDLBuilder() {
-        
+    public ServiceWSDLBuilder(ServiceInfo service) {
+        this.service = service;
+        prefix2ns = new HashMap<String, String>();
+        ns2prefix = new HashMap<String, String>();
     }
 
-    public static synchronized ServiceWSDLBuilder getServiceWSDLBuilder() {
-        if (serviceWSDLBuilder == null) {
-            serviceWSDLBuilder = new ServiceWSDLBuilder();
+    public Definition build() throws WSDLException {
+        try {
+            definition = service.getProperty(WSDLServiceBuilder.WSDL_DEFINITION, Definition.class);
+        } catch (ClassCastException e) {
+            //ignore
         }
-        return serviceWSDLBuilder;
+        if (definition == null) {
+            definition = WSDLFactory.newInstance().newDefinition();
+
+            addNamespace("wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/");
+            addNamespace("soap", "http://schemas.xmlsoap.org/soap/");
+            addNamespace("xsd", "http://www.w3.org/2001/XMLSchema");
+            
+            definition.setQName(service.getName());
+            definition.setTargetNamespace(service.getTargetNamespace());
+            addExtensibiltyElements(definition, getWSDL11Extensors(service));
+            if (service.getTypeInfo() != null) {
+                buildTypes(service.getTypeInfo());
+            }
+            buildPortType(service.getInterface());
+            buildBinding(service.getBindings());
+            buildService(service);
+        }
+        return definition;
+    }
+
+
+    public List<ExtensibilityElement> getWSDL11Extensors(AbstractPropertiesHolder holder) {
+//        List<?> extensors = holder.getExtensors()
+//        if (extensors.get() == null) {
+//            return null;
+//        }
+//        List<ExtensibilityElement> list
+//            = new ArrayList<ExtensibilityElement>(extensors.get().length);
+//        for (Object obj : extensors.get()) {
+//            if (obj instanceof ExtensibilityElement) {
+//                list.add((ExtensibilityElement)obj);
+//            }
+//        }
+//        return Collections.unmodifiableList(list);
+        return holder.getExtensors(ExtensibilityElement.class);
     }
     
-    private void addExtensibiltyElements(ElementExtensible elementExtensible, 
+    protected void addExtensibiltyElements(ElementExtensible elementExtensible, 
         List<ExtensibilityElement> extensibilityElements) {
         if (extensibilityElements != null) {
             for (ExtensibilityElement element : extensibilityElements) {
@@ -84,60 +128,38 @@
             }
         }
     }
-    
-    public Definition buildDefinition(ServiceInfo service) throws WSDLException {
-        Definition def = null;
-        try {
-            def = service.getProperty(WSDLServiceBuilder.WSDL_DEFINITION, Definition.class);
-        } catch (ClassCastException e) {
-            //ignore
-        }
-        if (def == null) {
-            def = WSDLFactory.newInstance().newDefinition();
-            def.setQName(service.getName());
-            def.setTargetNamespace(service.getTargetNamespace());
-            addExtensibiltyElements(def, service.getWSDL11Extensors());
-            if (service.getTypeInfo() != null) {
-                buildTypes(def, service.getTypeInfo());
-            }
-            buildPortType(def, service.getInterface());
-            buildBinding(def, service.getBindings());
-            buildService(def, service);
-        }
-        return def;
-    }
-
 
-    private void buildTypes(Definition def, TypeInfo typeInfo) {
-        Types types = def.createTypes();
+    protected void buildTypes(TypeInfo typeInfo) {
+        Types types = definition.createTypes();
         for (SchemaInfo schemaInfo : typeInfo.getSchemas()) {
             SchemaImpl schemaImpl = new SchemaImpl();
             schemaImpl.setElement(schemaInfo.getElement());
             types.addExtensibilityElement(schemaImpl);
         }
         
-        def.setTypes(types);
+        definition.setTypes(types);
     }
 
-    private void buildBinding(Definition def, Collection<BindingInfo> bindingInfos) {
+    protected void buildBinding(Collection<BindingInfo> bindingInfos) {
         Binding binding = null;
         for (BindingInfo bindingInfo : bindingInfos) {
-            binding = def.createBinding();
+            binding = definition.createBinding();
+            binding.setUndefined(false);
             for (PortType portType 
-                    : CastUtils.cast(def.getPortTypes().values(), PortType.class)) {
+                    : CastUtils.cast(definition.getPortTypes().values(), PortType.class)) {
                 if (portType.getQName().equals(bindingInfo.getInterface().getName())) {
                     binding.setPortType(portType);
                     break;
                 }
             }
             binding.setQName(bindingInfo.getName());
-            buildBindingOperation(def, binding, bindingInfo.getOperations());
-            addExtensibiltyElements(binding, bindingInfo.getWSDL11Extensors());
-            def.addBinding(binding);
+            buildBindingOperation(definition, binding, bindingInfo.getOperations());
+            addExtensibiltyElements(binding, getWSDL11Extensors(bindingInfo));
+            definition.addBinding(binding);
         }
     }
 
-    private void buildBindingOperation(Definition def, Binding binding, 
+    protected void buildBindingOperation(Definition def, Binding binding, 
                                        Collection<BindingOperationInfo> bindingOperationInfos) {
         BindingOperation bindingOperation = null;
         for (BindingOperationInfo bindingOperationInfo : bindingOperationInfos) {
@@ -153,12 +175,12 @@
             buildBindingInput(def, bindingOperation, bindingOperationInfo.getInput());
             buildBindingOutput(def, bindingOperation, bindingOperationInfo.getOutput());
             buildBindingFault(def, bindingOperation, bindingOperationInfo.getFaults());
-            addExtensibiltyElements(bindingOperation, bindingOperationInfo.getWSDL11Extensors());
+            addExtensibiltyElements(bindingOperation, getWSDL11Extensors(bindingOperationInfo));
             binding.addBindingOperation(bindingOperation);
         }
     }
 
-    private void buildBindingFault(Definition def, BindingOperation bindingOperation, 
+    protected void buildBindingFault(Definition def, BindingOperation bindingOperation, 
                                    Collection<BindingFaultInfo> bindingFaultInfos) {
         BindingFault bindingFault = null;
         for (BindingFaultInfo bindingFaultInfo 
@@ -166,48 +188,51 @@
             bindingFault = def.createBindingFault();
             bindingFault.setName(bindingFaultInfo.getFaultInfo().getFaultName().getLocalPart());
             bindingOperation.addBindingFault(bindingFault);
-            addExtensibiltyElements(bindingFault, bindingFaultInfo.getWSDL11Extensors());
+            addExtensibiltyElements(bindingFault, getWSDL11Extensors(bindingFaultInfo));
         }
         
     }
 
-    private void buildBindingInput(Definition def, BindingOperation bindingOperation, 
+    protected void buildBindingInput(Definition def, BindingOperation bindingOperation, 
                                          BindingMessageInfo bindingMessageInfo) {
         BindingInput bindingInput = null;
         if (bindingMessageInfo != null) {
             bindingInput = def.createBindingInput();
             bindingInput.setName(bindingMessageInfo.getMessageInfo().getName().getLocalPart());
             bindingOperation.setBindingInput(bindingInput);
-            addExtensibiltyElements(bindingInput, bindingMessageInfo.getWSDL11Extensors());
+            addExtensibiltyElements(bindingInput, getWSDL11Extensors(bindingMessageInfo));
         }
     }
     
-    private void buildBindingOutput(Definition def, BindingOperation bindingOperation, 
+    protected void buildBindingOutput(Definition def, BindingOperation bindingOperation, 
                                    BindingMessageInfo bindingMessageInfo) {
         BindingOutput bindingOutput = null;
         if (bindingMessageInfo != null) {
             bindingOutput = def.createBindingOutput();
             bindingOutput.setName(bindingMessageInfo.getMessageInfo().getName().getLocalPart());
             bindingOperation.setBindingOutput(bindingOutput);
-            addExtensibiltyElements(bindingOutput, bindingMessageInfo.getWSDL11Extensors());
+            addExtensibiltyElements(bindingOutput, getWSDL11Extensors(bindingMessageInfo));
         }
     }
 
-    private void buildService(Definition def, ServiceInfo service) {
-        Service serv = def.createService();
-        serv.setQName(service.getName());
-        def.addService(serv);
+    protected void buildService(ServiceInfo serviceInfo) {
+        Service serv = definition.createService();
+        serv.setQName(serviceInfo.getName());
+        addNamespace(serviceInfo.getName().getNamespaceURI());
+        definition.addService(serv);
 
-        for (EndpointInfo ei : service.getEndpoints()) {
-            Port port = def.createPort();
+        for (EndpointInfo ei : serviceInfo.getEndpoints()) {
+            addNamespace(ei.getTransportId());
+            addNamespace(ei.getBinding().getBindingId());
+            Port port = definition.createPort();
             port.setName(ei.getName().getLocalPart());
-            port.setBinding(def.getBinding(ei.getBinding().getName()));
-            addExtensibiltyElements(port, ei.getWSDL11Extensors());
+            port.setBinding(definition.getBinding(ei.getBinding().getName()));
+            addExtensibiltyElements(port, getWSDL11Extensors(ei));
             serv.addPort(port);
         }
     }
 
-    private void buildPortType(Definition def, InterfaceInfo intf) {
+    protected void buildPortType(InterfaceInfo intf) {
         PortType portType = null;
         try {
             portType = intf.getProperty(WSDLServiceBuilder.WSDL_PORTTYPE, PortType.class);
@@ -216,17 +241,27 @@
         }
         
         if (portType == null) {
-            portType = def.createPortType();
+            portType = definition.createPortType();
             portType.setQName(intf.getName());
-            buildPortTypeOperation(def, portType, intf.getOperations());
+            addNamespace(intf.getName().getNamespaceURI());
+            portType.setUndefined(false);
+            buildPortTypeOperation(portType, intf.getOperations());
         }
 
-        def.addPortType(portType);
+        definition.addPortType(portType);
     }
 
+    protected void addNamespace(String namespaceURI) {
+        addNamespace(getPrefix(namespaceURI), namespaceURI);
+    }
 
-    private void buildPortTypeOperation(Definition def, 
-                                        PortType portType, Collection<OperationInfo> operationInfos) {
+    protected void addNamespace(String prefix, String namespaceURI) {
+        prefix2ns.put(prefix, namespaceURI);
+        ns2prefix.put(namespaceURI, prefix);
+        definition.addNamespace(prefix, namespaceURI);
+    }
+
+    protected void buildPortTypeOperation(PortType portType, Collection<OperationInfo> operationInfos) {
         for (OperationInfo operationInfo : operationInfos) {
             Operation operation = null;
             try {
@@ -237,32 +272,34 @@
             }
             
             if (operation == null) {
-                operation = def.createOperation();
+                operation = definition.createOperation();
+                operation.setUndefined(false);
                 operation.setName(operationInfo.getName().getLocalPart());
+                addNamespace(operationInfo.getName().getNamespaceURI());
                 if (operationInfo.isOneWay()) {
                     operation.setStyle(OperationType.ONE_WAY);
                 }
-                Input input = def.createInput();
+                Input input = definition.createInput();
                 input.setName(operationInfo.getInputName());
-                Message message = def.createMessage();
-                buildMessage(def, message, operationInfo.getInput());
+                Message message = definition.createMessage();
+                buildMessage(message, operationInfo.getInput());
                 input.setMessage(message);
                 operation.setInput(input);
                 
-                Output output = def.createOutput();
+                Output output = definition.createOutput();
                 output.setName(operationInfo.getOutputName());
-                message = def.createMessage();
-                buildMessage(def, message, operationInfo.getOutput());
+                message = definition.createMessage();
+                buildMessage(message, operationInfo.getOutput());
                 output.setMessage(message);
                 operation.setOutput(output);
                 //loop to add fault
                 Collection<FaultInfo> faults = operationInfo.getFaults();
                 Fault fault = null;
                 for (FaultInfo faultInfo : faults) {
-                    fault = def.createFault();
+                    fault = definition.createFault();
                     fault.setName(faultInfo.getFaultName().getLocalPart());
-                    message = def.createMessage();
-                    buildMessage(def, message, faultInfo);
+                    message = definition.createMessage();
+                    buildMessage(message, faultInfo);
                     fault.setMessage(message);
                     operation.addFault(fault);
                 }
@@ -271,18 +308,41 @@
         }
     }
 
+    protected String getPrefix(String ns) {
+        String prefix = ns2prefix.get(ns);
+        if (prefix == null) {
+            prefix = getNewPrefix();
+            ns2prefix.put(ns, prefix);
+        }
+        return prefix;
+    }
+    
+    protected String getNewPrefix() {
+        String prefix = "ns1";
+        int i = 0;
+        while (prefix2ns.get(prefix) != null) {
+            i++;
+            prefix = "ns" + i;
+        }
+        return prefix;
+    }
 
-    private void buildMessage(Definition def, Message message,  AbstractMessageContainer messageContainer) {
+    protected void buildMessage(Message message, AbstractMessageContainer messageContainer) {
         message.setQName(messageContainer.getName());
+        message.setUndefined(false);
+        definition.addMessage(message);
+        
         List<MessagePartInfo> messageParts = messageContainer.getMessageParts();
         Part messagePart = null;
         for (MessagePartInfo messagePartInfo : messageParts) {
-            messagePart = def.createPart();
+            messagePart = definition.createPart();
             messagePart.setName(messagePartInfo.getName().getLocalPart());
             if (messagePartInfo.isElement()) {
                 messagePart.setElementName(messagePartInfo.getElementQName());
-            } else {
+                addNamespace(messagePartInfo.getElementQName().getNamespaceURI());
+            } else if (messagePartInfo.getTypeQName() != null) {
                 messagePart.setTypeName(messagePartInfo.getTypeQName());
+                addNamespace(messagePartInfo.getTypeQName().getNamespaceURI());
             }
             message.addPart(messagePart);
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Mon Oct  9 12:19:18 2006
@@ -283,7 +283,8 @@
 
     private void handleHeader(BindingMessageInfo bindingMessageInfo) {
         // mark all message part which should be in header
-        List<ExtensibilityElement> extensiblilityElement = bindingMessageInfo.getWSDL11Extensors();
+        List<ExtensibilityElement> extensiblilityElement = 
+            bindingMessageInfo.getExtensors(ExtensibilityElement.class);
         // for non-soap binding, the extensiblilityElement could be null
         if (extensiblilityElement == null) {
             return;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java Mon Oct  9 12:19:18 2006
@@ -42,23 +42,28 @@
     
     private URL wsdlUrl;
     private QName serviceName;
-        
-    public WSDLServiceFactory(Bus b, URL url, QName sn) {
+    private Definition definition;
+    
+    public WSDLServiceFactory(Bus b, Definition d, QName sn) {
         setBus(b);
-        wsdlUrl = url;
+        definition = d;
         serviceName = sn;        
     }
     
-    public Service create() {
-        // use wsdl manager to parse wsdl or get cached definition
+    public WSDLServiceFactory(Bus b, URL url, QName sn) {
+        setBus(b);
+        wsdlUrl = url;
+        serviceName = sn;        
         
-        Definition definition = null;
         try {
+            // use wsdl manager to parse wsdl or get cached definition
             definition = getBus().getExtension(WSDLManager.class).getDefinition(wsdlUrl);
         } catch (WSDLException ex) {
             throw new ServiceConstructionException(new Message("SERVICE_CREATION_MSG", LOG), ex);
         }
-        
+    }
+    
+    public Service create() {
         javax.wsdl.Service wsdlService = definition.getService(serviceName);
         if (wsdlService == null) {
             throw new ServiceConstructionException(new Message("NO_SUCH_SERVICE", LOG, serviceName));

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java Mon Oct  9 12:19:18 2006
@@ -99,7 +99,7 @@
         serviceInfo = wsdlServiceBuilder.buildService(def, service);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
-        newDef = ServiceWSDLBuilder.getServiceWSDLBuilder().buildDefinition(serviceInfo);
+        newDef = new ServiceWSDLBuilder(serviceInfo).build();
         
     }
     

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java Mon Oct  9 12:19:18 2006
@@ -44,7 +44,7 @@
     @Override
     public void begin(MessagePartInfo part) {
         // Check to see if the WSDL information has been filled in for us.
-        if (part.getConcreteName() != null) {
+        if (part.getTypeQName() != null || part.getElementQName() != null) {
             return;
         }
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java Mon Oct  9 12:19:18 2006
@@ -293,10 +293,8 @@
             OutputStream os = resp.getOutputStream();
             
             WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
-            Definition def = 
-                ServiceWSDLBuilder.getServiceWSDLBuilder().buildDefinition(endpointInfo.getService());
-            Port port = def.getService(
-                                       endpointInfo.getService().getName()).getPort(
+            Definition def = new ServiceWSDLBuilder(endpointInfo.getService()).build();
+            Port port = def.getService(endpointInfo.getService().getName()).getPort(
                                        endpointInfo.getName().getLocalPart());
             List<?> exts = port.getExtensibilityElements();
             if (exts.size() > 0) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java Mon Oct  9 12:19:18 2006
@@ -20,6 +20,10 @@
 
 import java.util.Collection;
 
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+
+import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 import org.apache.cxf.Bus;
@@ -30,15 +34,19 @@
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
 
 public class CodeFirstTest extends AbstractJaxWsTest {
+    String address = "http://localhost:9000/Hello";
+    
     public void testModel() throws Exception {
         JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
 
         Bus bus = getBus();
         bean.setBus(bus);
         bean.setServiceClass(Hello.class);
-
+        bean.setWrapped(false);
+        
         Service service = bean.create();
 
         InterfaceInfo i = service.getServiceInfo().getInterface();
@@ -48,10 +56,26 @@
         svrFactory.setBus(bus);
         svrFactory.setServiceFactory(bean);
         svrFactory.setTransportId("http://schemas.xmlsoap.org/soap/");
+        svrFactory.setAddress(address);
         svrFactory.create();
         
         Collection<BindingInfo> bindings = service.getServiceInfo().getBindings();
         assertEquals(1, bindings.size());
+        
+        ServiceWSDLBuilder wsdlBuilder = 
+            new ServiceWSDLBuilder(service.getServiceInfo());
+        Definition d = wsdlBuilder.build();
+        
+        Document wsdl = WSDLFactory.newInstance().newWSDLWriter().getDocument(d);
+        
+        addNamespace("svc", "http://service.jaxws.cxf.apache.org");
+        
+        assertValid("/wsdl:definitions/wsdl:service[@name='Hello']", wsdl);
+        assertValid("//wsdl:port/wsdlsoap:address[@location='" + address + "']", wsdl);
+        assertValid("//wsdl:portType[@name='HelloPortType']", wsdl);
+        assertValid("/wsdl:definitions/wsdl:message[@name='sayHi']"
+                    + "/wsdl:part[@type='xsd:string'][@name='text']",
+                    wsdl);
     }
 
     public void testEndpoint() throws Exception {

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java Mon Oct  9 12:19:18 2006
@@ -55,6 +55,10 @@
         return null;
     }
 
+    public Boolean isWrapped(Method m) { 
+        return null;
+    }
+    
     public Boolean isOutParam(Method method, int j) {
         return null;
     }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java Mon Oct  9 12:19:18 2006
@@ -90,12 +90,12 @@
 
     @Override
     public QName getInterfaceName() {
-        return new QName(getServiceNamespace(), getServiceName() + "PortType");
+        return new QName(getServiceFactory().getServiceNamespace(), getServiceName() + "PortType");
     }
 
     @Override
     public QName getEndpointName() {
-        return new QName(getServiceNamespace(), getServiceName() + "Port");
+        return new QName(getServiceFactory().getServiceNamespace(), getServiceName() + "Port");
     }
 
     @Override
@@ -148,4 +148,8 @@
         return j < 0;
     }
 
+    @Override
+    public Boolean isWrapped(Method m) {
+        return getServiceFactory().isWrapped();
+    }
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Mon Oct  9 12:19:18 2006
@@ -77,6 +77,7 @@
     private Executor executor;
     private List<String> ignoredClasses = new ArrayList<String>();
     private SimpleMethodDispatcher methodDispatcher = new SimpleMethodDispatcher();
+    private boolean wrappedStyle = true;
     
     public ReflectionServiceFactoryBean() {
         getServiceConfigurations().add(0, new DefaultServiceConfiguration());
@@ -374,12 +375,12 @@
     }
     
     protected boolean isWrapped(final Method method) {
-//        for (AbstractServiceConfiguration c : serviceConfigurations) {
-//            Boolean b = c.isOperation(method);
-//            if (b != null) {
-//                return b.booleanValue();
-//            }
-//        }
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            Boolean b = c.isWrapped(method);
+            if (b != null) {
+                return b.booleanValue();
+            }
+        }
         return true;
     }
 
@@ -661,4 +662,13 @@
     public void setIgnoredClasses(List<String> ignoredClasses) {
         this.ignoredClasses = ignoredClasses;
     }
+
+    public boolean isWrapped() {
+        return wrappedStyle;
+    }
+
+    public void setWrapped(boolean style) {
+        this.wrappedStyle = style;
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java Mon Oct  9 12:19:18 2006
@@ -44,10 +44,15 @@
     private Bus bus;
     private String address;
     private String transportId; // where should this come from???
-    private AbstractBindingInfoFactoryBean bindingFactory = new SoapBindingInfoFactoryBean();
+    private AbstractBindingInfoFactoryBean bindingFactory;
     private QName endpointName;
     private boolean start = true;
     
+    public ServerFactoryBean() {
+        super();
+        bindingFactory = new SoapBindingInfoFactoryBean();
+    }
+
     public Server create() {
         try {
             service = serviceFactory.getService();
@@ -107,6 +112,7 @@
         } else {
             // ?
         }
+        service.getServiceInfo().addEndpoint(ei);
         return ei;
     }
 
@@ -172,6 +178,14 @@
 
     public void setStart(boolean start) {
         this.start = start;
+    }
+
+    public AbstractBindingInfoFactoryBean getBindingFactory() {
+        return bindingFactory;
+    }
+
+    public void setBindingFactory(AbstractBindingInfoFactoryBean bindingFactory) {
+        this.bindingFactory = bindingFactory;
     }
     
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java Mon Oct  9 12:19:18 2006
@@ -31,7 +31,9 @@
 
 public class SoapBindingInfoFactoryBean extends AbstractBindingInfoFactoryBean {
     private SoapVersion soapVersion = Soap11.getInstance();
-
+    private String style = "document";
+    private String use;
+    
     @Override
     public BindingInfo create() {
         ServiceInfo si = getServiceInfo();
@@ -66,11 +68,11 @@
     }
 
     protected String getStyle() {
-        return "document";
+        return style;
     }
 
     protected String getStyle(OperationInfo op) {
-        return "document";
+        return getStyle();
     }
 
     protected QName getBindingName() {
@@ -86,4 +88,17 @@
     public void setSoapVersion(SoapVersion soapVersion) {
         this.soapVersion = soapVersion;
     }
+
+    public String getUse() {
+        return use;
+    }
+
+    public void setUse(String use) {
+        this.use = use;
+    }
+
+    public void setStyle(String style) {
+        this.style = style;
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java?view=diff&rev=454465&r1=454464&r2=454465
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java Mon Oct  9 12:19:18 2006
@@ -118,7 +118,8 @@
                             public void handle(String pathInContext, String pathParams,
                                                HttpRequest req, HttpResponse resp)
                                 throws IOException {
-                                if (pathInContext.startsWith(getName())) {
+                                String name = getName();
+                                if (pathInContext.startsWith(name)) {
                                     doService(req, resp);                    
                                 }
                             }
@@ -265,8 +266,7 @@
                 OutputStream os = resp.getOutputStream();
                 
                 WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
-                Definition def = 
-                    ServiceWSDLBuilder.getServiceWSDLBuilder().buildDefinition(endpointInfo.getService());
+                Definition def = new ServiceWSDLBuilder(endpointInfo.getService()).build();
                 wsdlWriter.writeWSDL(def, os);
                 resp.getOutputStream().flush();
                 resp.commit();



Mime
View raw message