cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r488948 [1/3] - in /incubator/cxf/trunk: ./ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/service/model/ buildtools/src/main/resources/ integration/jca/src/main/java/org/apache...
Date Wed, 20 Dec 2006 08:07:59 GMT
Author: dandiep
Date: Wed Dec 20 00:07:54 2006
New Revision: 488948

URL: http://svn.apache.org/viewvc?view=rev&rev=488948
Log:
o Renamed SoapDestinationFactory to SoapTransportFactory as it now can work
  as a conduit too when creating client proxies.
o Refactor Holder logic to interceptors. This is to help the seperation of 
  JAX-WS logic from the EndpointInvocationHandler and also so we can support
  the XFire Aegis databinding Holder class (coming once I get the XFire 
  Aegis support finished). I don't like the way I implemented this at all.
  Especially since SoapOutInterceptor needs to look for -1 in the type index.
  I think we should probably come up with a better method.
o Separated JAX-WS EndpointInvocationHandler logic out so the Simple frontend
  can have clients.
o Rename EndpointInvocationHandler to ClientProxy and add 
  ClientProxy.getClient(Object) to make it easy to get the underlying client. 
  This will make it easier to add interceptors to a Client.
o Add a bunch of toString() methods to the service model to make debugging
  easier.
o Move HeaderTest to jax-ws module and use local transport. Test now takes
  .3 seconds instead of 8. Makes for much faster debugging.
o Support get/setServerBean on ServerFactoryBean
o Add logging to PhaseInteceptorChain so it can be visualized. Just turn
  logging up to Fine and it will print out a diagram of the phases and the
  interceptors in that phase.
o Fix race condition with PhaseInterceptorChain's pause/resume. There was a
  problem with WS-A/RM in that the executor was resuming the flow before
  the current interceptor had returned and the pausedMessage was set. Now
  doInterceptor notifies resume() once its finished pausing. resume() will
  wait for one second for the chain to finish pausing.

A couple thoughts from things I noticed while going through the code:
- we seem to be removing the ws-a/ws-rm headers from the header tree. Why?? 
  People will want to see these IMO and they'll be surprised that they're gone.
- As noticed on the mailing list a few days ago, I think there are issues
  with the JaxwsInterceptorRemover approach long term. I had to add the holder
  interceptors to the list so that they were removed as well.
- SequencetTest was failing sporadically depending on whether or not logging
  was turned up before I fixed the race condition. This took a very long time to 
  figure out... Anyone have hints on how to best debug RM? I started adding a 
  server side only test which played messages against the server and that helped.
  Single threaded tests are so much easier to debug. But I need to clean it up 
  yet and get it fully working before I can commit. (only tests CreateSequence
  right now)


Added:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
      - copied, changed from r481634, incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
      - copied, changed from r481634, incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/MethodDispatcher.java
      - copied, changed from r488793, incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncCallbackFuture.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSAsyncCallable.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
      - copied, changed from r486881, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
      - copied, changed from r481634, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java
      - copied, changed from r482349, incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/echo.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/echo2.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/echo3.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/echoResponse.xml   (with props)
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
      - copied, changed from r488793, incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractEndpointFactory.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
      - copied, changed from r488793, incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ClientFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/Messages.properties   (with props)
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
      - copied, changed from r488793, 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/frontend/SimpleMethodDispatcher.java
      - copied, changed from r488793, incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/HelloServiceImpl.java   (with props)
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/RountripTest.java   (with props)
Removed:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/echoData.xml
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractEndpointFactory.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ClientFactoryBean.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/SimpleMethodDispatcher.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
    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/BindingOperationInfo.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/OperationInfo.java
    incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml
    incubator/cxf/trunk/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
    incubator/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java
    incubator/cxf/trunk/pom.xml
    incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingInfoFactoryBean.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/SoapBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension-soap.xml
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.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/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ClientFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/fault-stack-trace.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/js/Server.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/JaxwsInterceptorRemover.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java Wed Dec 20 00:07:54 2006
@@ -32,7 +32,6 @@
 import java.io.OutputStreamWriter;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -104,6 +103,7 @@
     protected abstract void doClose() throws IOException;
 
     public void close() throws IOException {
+        currentStream.flush();
         currentStream.close();
         if (null != callbacks) {
             for (CachedOutputStreamCallback cb : callbacks) {
@@ -197,7 +197,11 @@
     }
 
     public String toString() {
-        return currentStream.toString();
+        return new StringBuilder().append("[")
+            .append(super.toString())
+            .append(" Content: ")
+            .append(currentStream.toString())
+            .append("]").toString();
     }
 
     protected abstract void onWrite() throws IOException;

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=488948&r1=488947&r2=488948
==============================================================================
--- 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 Wed Dec 20 00:07:54 2006
@@ -64,6 +64,7 @@
     private PhaseInterceptorIterator iterator;
     private Message pausedMessage;
     private MessageObserver faultObserver;
+    private Object pauseWaitObject = new Object();
     
     // currently one chain for one request/response, use below as signal to avoid duplicate fault processing
     // on nested calling of doIntercept(), which will throw same fault multi-times
@@ -124,6 +125,17 @@
     public void resume() {
         if (state == State.PAUSED) {
             state = State.EXECUTING;
+            
+            if (pausedMessage == null) {
+                synchronized (pauseWaitObject) {
+                    try {
+                        pauseWaitObject.wait(1000);
+                    } catch (InterruptedException e) {
+                        // do nothing
+                    }
+                }
+            }
+            
             doIntercept(pausedMessage);
         }
     }
@@ -177,6 +189,9 @@
             state = State.COMPLETE;
         } else if (state == State.PAUSED) {
             pausedMessage = message;
+            synchronized (pauseWaitObject) {
+                pauseWaitObject.notifyAll();
+            }
         }
         return state == State.COMPLETE;
     }
@@ -271,7 +286,7 @@
 
         for (int i = 0; i < intercs.size(); i++) {
             PhaseInterceptor cmp = (PhaseInterceptor)intercs.get(i);
-
+            
             if (cmp.getId() == null) {
                 continue;
             }
@@ -300,6 +315,40 @@
         intercs.add(begin + 1, interc);
     }
 
+    void outputChainToLog(boolean modified) {
+        if (LOG.isLoggable(Level.FINE)) {
+            StringBuilder chain = new StringBuilder();
+            
+            if (modified) {
+                chain.append("Chain ")
+                    .append(toString())
+                    .append(" was modified. Current flow:\n");
+            } else {
+                chain.append("Chain ")
+                    .append(toString())
+                    .append(" was created. Current flow:\n");
+            }
+            
+            for (Map.Entry<Phase, List<Interceptor>> entry : interceptors.entrySet()) {
+                chain.append("  ")
+                    .append(entry.getKey().getName())
+                    .append(" [");
+                
+                boolean first = true;
+                for (Interceptor i : entry.getValue()) {
+                    if (first) {
+                        first = false;
+                    } else {
+                        chain.append(", ");
+                    }
+                    chain.append(i.getClass().getSimpleName());
+                }
+                
+                chain.append("]\n");
+            }
+            LOG.fine(chain.toString());
+        }
+    }
     
     class PhaseInterceptorIterator implements ListIterator<Interceptor<? extends Message>> {
         List<Interceptor<? extends Message>> called
@@ -309,6 +358,7 @@
         List<Interceptor> currentPhase;
         Iterator<Interceptor> currentPhaseIterator;
         Interceptor<? extends Message> last;
+        boolean first = true;
         
         PhaseInterceptorIterator() {
             phases = interceptors.values().iterator();
@@ -329,7 +379,13 @@
                     refreshIterator();
                 }
                 return hasNext();
+            } 
+            
+            if (first) {
+                outputChainToLog(false);
+                first = false;
             }
+            
             return false;
         }
         private void refreshIterator() {
@@ -401,6 +457,7 @@
                 currentPhaseIterator = currentPhase.iterator();
                 last = null;
             }
+            outputChainToLog(true);
         }
     }
 

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java Wed Dec 20 00:07:54 2006
@@ -126,4 +126,12 @@
     public BindingOperationInfo getWrappedOperation() {
         return opHolder;
     }
+
+    @Override
+    public String toString() {
+        return new StringBuilder().append("[BindingOperationInfo: ")
+            .append(getName())
+            .append("]").toString();
+    }
+    
 }

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=488948&r1=488947&r2=488948
==============================================================================
--- 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 Wed Dec 20 00:07:54 2006
@@ -25,8 +25,6 @@
 
 public final class MessagePartInfo extends AbstractPropertiesHolder {
     
-    public static final String KEY_SKIPPED = "SKIPPED";
-    
     private QName pname;
     private AbstractMessageContainer mInfo;
     
@@ -35,6 +33,7 @@
     private QName elementName;
     private XmlSchemaAnnotated xmlSchema;
     private Class<?> typeClass;
+    private int index;
     
     public MessagePartInfo(QName n, AbstractMessageContainer info) {
         mInfo = info;
@@ -103,4 +102,23 @@
     public void setTypeClass(Class<?> typeClass) {
         this.typeClass = typeClass;
     }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder().append("[MessagePartInfo name=")
+            .append(getName())
+            .append(", ConcreteName=")
+            .append(getConcreteName()).toString();
+    }
+    
+    
+    
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java Wed Dec 20 00:07:54 2006
@@ -195,4 +195,11 @@
         }
         return Collections.unmodifiableCollection(faults.values());
     }
+    
+    @Override
+    public String toString() {
+        return new StringBuilder().append("[OperationInfo: ")
+            .append(opName)
+            .append("]").toString();
+    }
 }

Modified: incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml (original)
+++ incubator/cxf/trunk/buildtools/src/main/resources/cxf-pmd-ruleset.xml Wed Dec 20 00:07:54 2006
@@ -87,7 +87,7 @@
 <!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
 <!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
 <!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
-<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/-->
 <!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
 <!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
 <rule ref="rulesets/design.xml/IdempotentOperations"/>

Modified: incubator/cxf/trunk/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java (original)
+++ incubator/cxf/trunk/integration/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java Wed Dec 20 00:07:54 2006
@@ -51,9 +51,10 @@
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
@@ -61,7 +62,6 @@
 import org.apache.cxf.jca.core.resourceadapter.UriHandlerInit;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.service.factory.ServerFactoryBean;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.http.HTTPTransportFactory;
@@ -118,7 +118,7 @@
 
             DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
-            SoapDestinationFactory soapDF = new SoapDestinationFactory();
+            SoapTransportFactory soapDF = new SoapTransportFactory();
             soapDF.setBus(bus);
             dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
             dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
@@ -296,7 +296,7 @@
         }
         String address = "http://" + hostName + ":9999/" + jndiName;
 
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         Service service = createService(interfaceClass, bean);
         
         // REVISIT this is easy to be replace by EJBMethodInvoker

Modified: incubator/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java (original)
+++ incubator/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java Wed Dec 20 00:07:54 2006
@@ -41,14 +41,15 @@
 // import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
@@ -330,7 +331,7 @@
         jcaBusFactory.setBus(springBus);
         jcaBusFactory.initBus();
         
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         Service service = jcaBusFactory.createService(HelloInterface.class, bean);
         assertEquals("test", service.get("test"));
     }
@@ -345,7 +346,7 @@
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
-        SoapDestinationFactory soapDF = new SoapDestinationFactory();
+        SoapTransportFactory soapDF = new SoapTransportFactory();
         soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
@@ -368,7 +369,7 @@
         jcaBusFactory.setBus(bus);
         jcaBusFactory.initBus();
         
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         Service service = jcaBusFactory.createService(HelloInterface.class, bean);
         assertEquals("test", service.get("test"));
         

Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Wed Dec 20 00:07:54 2006
@@ -323,6 +323,7 @@
                         <!-- do not exclude **/Abstract*Test.java **/Abstract*TestCase.java -->
                         <excludes>
                             <exclude>**/*$*</exclude>
+                            <exclude>**/LocatorClientServerTest.java</exclude>
                         </excludes>
                         <reportFormat>${surefire.format}</reportFormat>
                         <useFile>${surefire.usefile}</useFile>

Modified: incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingInfoFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingInfoFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingInfoFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/HttpBindingInfoFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -27,9 +27,9 @@
 import org.apache.cxf.binding.http.strategy.ConventionStrategy;
 import org.apache.cxf.binding.http.strategy.JRAStrategy;
 import org.apache.cxf.binding.http.strategy.ResourceStrategy;
+import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
-import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;

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=488948&r1=488947&r2=488948
==============================================================================
--- 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 Wed Dec 20 00:07:54 2006
@@ -35,7 +35,6 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
-
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.BindingFactoryManager;
@@ -48,7 +47,7 @@
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapInPostInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
@@ -149,6 +148,7 @@
         sb.getInInterceptors().add(new ReadHeadersInterceptor());
         sb.getInInterceptors().add(new MustUnderstandInterceptor());
         sb.getInInterceptors().add(new StaxInInterceptor());        
+        sb.getInInterceptors().add(new SoapHeaderInterceptor());
         
         sb.getOutInterceptors().add(new SoapActionInterceptor());
         sb.getOutInterceptors().add(new AttachmentOutInterceptor());
@@ -174,7 +174,6 @@
         } else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                         && SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle)) {
             sb.getInInterceptors().add(new BareInInterceptor());
-            sb.getInInterceptors().add(new SoapInPostInterceptor());
             sb.getOutInterceptors().add(new BareOutInterceptor());
         } else {
             sb.getInInterceptors().add(new WrappedInInterceptor());
@@ -218,7 +217,6 @@
 
             soi.setAction(action);
             soi.setStyle(soapOp.getStyle());
-
         }
 
         boi.addExtensor(soi);
@@ -247,16 +245,12 @@
                 MessagePartInfo part = msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), header
                                 .getPart()));
                 if (part != null) {
-                    for (int i = 0; i < msg.getMessageParts().size(); i++) {
-                        if (msg.getMessagePartByIndex(i) == part) {
-                            headerInfo.setSequence(i);
-                        }
-                    }
                     headerInfo.setPart(part);
                     messageParts.remove(part);
                     bmsg.addExtensor(headerInfo);
                 }
             }
+            
             // Exclude the header parts from the message part list.
             bmsg.setMessageParts(messageParts);
         }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -18,13 +18,20 @@
  */
 package org.apache.cxf.binding.soap;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
+import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 
@@ -54,9 +61,59 @@
             bop.addExtensor(sop);
             
             info.addOperation(bop);
+            
+            
+            BindingMessageInfo bInput = bop.getInput();
+            if (bInput != null) {
+                MessageInfo input = null;
+                BindingMessageInfo unwrappedMsg = bInput;
+                if (bop.isUnwrappedCapable()) {
+                    input = bop.getOperationInfo().getUnwrappedOperation().getInput();
+                    unwrappedMsg = bop.getUnwrappedOperation().getInput();
+                } else {
+                    input = bop.getOperationInfo().getInput();
+                }
+                setupHeaders(bop, bInput, unwrappedMsg, input);
+            }
+            
+            BindingMessageInfo bOutput = bop.getOutput();
+            if (bOutput != null) {
+                MessageInfo output = null;
+                BindingMessageInfo unwrappedMsg = bOutput;
+                if (bop.isUnwrappedCapable()) {
+                    output = bop.getOperationInfo().getUnwrappedOperation().getOutput();
+                    unwrappedMsg = bop.getUnwrappedOperation().getOutput();
+                } else {
+                    output = bop.getOperationInfo().getOutput();
+                }
+                setupHeaders(bop, bOutput, unwrappedMsg, output);
+            }
         }
         
         return info;
+    }
+
+    private void setupHeaders(BindingOperationInfo op, 
+                              BindingMessageInfo bMsg, 
+                              BindingMessageInfo unwrappedBMsg, 
+                              MessageInfo msg) {
+        List<MessagePartInfo> parts = new ArrayList<MessagePartInfo>();
+        for (MessagePartInfo part : msg.getMessageParts()) {
+            if (isHeader(op, part)) {
+                SoapHeaderInfo headerInfo = new SoapHeaderInfo();
+                headerInfo.setPart(part);
+                headerInfo.setUse(getUse());
+
+                bMsg.addExtensor(headerInfo);
+            } else {
+                parts.add(part);
+            }
+        }
+        unwrappedBMsg.setMessageParts(parts);
+    }
+
+    protected boolean isHeader(BindingOperationInfo op, MessagePartInfo part) {
+        return false;
     }
 
     private String getSoapAction(OperationInfo op) {

Copied: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java (from r481634, 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/SoapTransportFactory.java?view=diff&rev=488948&p1=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java&r1=481634&p2=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java&r2=488948
==============================================================================
--- 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/SoapTransportFactory.java Wed Dec 20 00:07:54 2006
@@ -44,17 +44,21 @@
 import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
 import org.apache.cxf.transport.AbstractTransportFactory;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
 import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl11.WSDLEndpointFactory;
 
-public class SoapDestinationFactory extends AbstractTransportFactory implements DestinationFactory,
-    WSDLEndpointFactory {
+public class SoapTransportFactory extends AbstractTransportFactory implements DestinationFactory,
+    WSDLEndpointFactory, ConduitInitiator {
     public static final String TRANSPORT_ID = "http://schemas.xmlsoap.org/soap/";
     private Bus bus;
 
-    public SoapDestinationFactory() {
+    public SoapTransportFactory() {
         super();
     }
 
@@ -129,6 +133,25 @@
         }
 
         return null;
+    }
+    
+
+    public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target) throws IOException {
+        return getConduit(ei);
+    }
+
+    public Conduit getConduit(EndpointInfo ei) throws IOException {
+        SoapBindingInfo binding = (SoapBindingInfo)ei.getBinding();
+        ConduitInitiator conduitInit;
+        try {
+            conduitInit = bus.getExtension(ConduitInitiatorManager.class)
+                .getConduitInitiator(binding.getTransportURI());
+
+            return conduitInit.getConduit(ei);
+        } catch (BusException e) {
+            throw new RuntimeException("Could not find destination factory for transport "
+                                       + binding.getTransportURI());
+        }
     }
 
     public Bus getBus() {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java Wed Dec 20 00:07:54 2006
@@ -36,6 +36,7 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -72,11 +73,13 @@
 
         if (message.getExchange().get(BindingOperationInfo.class) == null) {
             operation = getOperation(message, new QName(xmlReader.getNamespaceURI(), opName));
+            message.getExchange().put(BindingOperationInfo.class, operation);
+            message.getExchange().put(OperationInfo.class, operation.getOperationInfo());
+
             if (operation == null) {
                 // it's doc-lit-bare
                 new BareInInterceptor().handleMessage(message);
             }
-            message.getExchange().put(BindingOperationInfo.class, operation);
         } else {
             operation = message.getExchange().get(BindingOperationInfo.class);
         }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java Wed Dec 20 00:07:54 2006
@@ -63,9 +63,9 @@
             List<MessagePartInfo> parts = null;
 
             if (!isRequestor(message)) {
-                parts = operation.getOutput().getMessageInfo().getMessageParts();
+                parts = operation.getOutput().getMessageParts();
             } else {
-                parts = operation.getInput().getMessageInfo().getMessageParts();
+                parts = operation.getInput().getMessageParts();
             }
             countParts = parts.size();
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java Wed Dec 20 00:07:54 2006
@@ -69,9 +69,6 @@
         }
 
         try {
-            while (xmlReader.isWhiteSpace()) { 
-                xmlReader.next(); 
-            } 
             if (xmlReader.nextTag() == XMLStreamConstants.START_ELEMENT) {
                 String ns = xmlReader.getNamespaceURI();
                 SoapVersion soapVersion = SoapVersionFactory.getInstance().getSoapVersion(ns);
@@ -91,7 +88,7 @@
                 
                     Document doc = StaxUtils.read(filteredReader);
 
-                    Element element = (Element)doc.getChildNodes().item(0);
+                    Element element = doc.getDocumentElement();
                     message.setHeaders(Element.class, element);
                     message.put(Element.class, element);                    
                 }

Copied: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java (from r481634, incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java?view=diff&rev=488948&p1=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java&r1=481634&p2=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java Wed Dec 20 00:07:54 2006
@@ -19,18 +19,16 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
+import javax.xml.namespace.QName;
+
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
-import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
@@ -38,108 +36,86 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.OperationInfo;
 
-public class SoapInPostInterceptor extends AbstractInDatabindingInterceptor {
+/**
+ * Perform databinding of the SOAP headers.
+ */
+public class SoapHeaderInterceptor extends AbstractInDatabindingInterceptor {
 
-    public SoapInPostInterceptor() {
+    public SoapHeaderInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
         addAfter(BareInInterceptor.class.getName());
     }
 
-    public void handleMessage(Message message) throws Fault {
+    public void handleMessage(Message m) throws Fault {
+        SoapMessage message = (SoapMessage) m;
         Exchange exchange = message.getExchange();
 
         List<Object> parameters = CastUtils.cast(message.getContent(List.class));
-
-        Endpoint ep = exchange.get(Endpoint.class);
-        Service service = ep.getService();
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
-
-        if (message.get(Element.class) != null) {
-            parameters.addAll(abstractParamsFromHeader(message.get(Element.class), ep, message));
+        if (bop.isUnwrapped()) {
+            bop = bop.getWrappedOperation();
         }
-
-        // if we didn't know the operation going into this, find it.
-        if (bop == null) {
-            for (OperationInfo op : service.getServiceInfo().getInterface().getOperations()) {
-                Method method = (Method) op.getExtensor(Method.class);
-                if (!isMethodMatch(parameters, method)) {
-                    continue;
-                }
-                bop = ep.getEndpointInfo().getBinding().getOperation(op);
-                exchange.put(BindingOperationInfo.class, bop);
-                exchange.setOneWay(op.isOneWay());
-                break;
-            }
-            if (bop == null) {
-                throw new Fault(new RuntimeException("Can not find target operation"));
+        
+        boolean client = isRequestor(message);
+        BindingMessageInfo bmi = client ? bop.getOutput() : bop.getInput();
+        if (bmi == null) {
+            // one way operation.
+            return;
+        }
+        
+        List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
+        if (headers == null) {
+            return;
+        }
+        
+        Element headerElement = message.getHeaders(Element.class);
+        for (SoapHeaderInfo header : headers) {
+            MessagePartInfo mpi = header.getPart();
+            Element param = findHeader(headerElement, mpi);
+            
+            int idx = mpi.getIndex();
+            Object object = null;
+            if (param != null) {
+                object = getNodeDataReader(message).read(mpi, param);
+            }
+            
+            if (client) {
+                // Return parameter needs to be first, so bump everything
+                // back one notch.
+                idx++;
+            }
+            
+            if (idx > parameters.size()) {
+                parameters.add(object);
+            } else if (idx == -1) {
+                parameters.add(0, object);
+            } else {
+                parameters.add(idx, object);
             }
         }
-
         message.setContent(List.class, parameters);
     }
 
-    private boolean isMethodMatch(List params, Method method) {
-        Class[] cls = method.getParameterTypes();
-        Type[] types = method.getGenericParameterTypes();
-        if (params.size() != cls.length) {
-            return false;
-        }
-        for (int i = 0; i < cls.length; i++) {
-            Class valueClass = cls[i];
-            if (cls[i].getName().equals("javax.xml.ws.Holder")) {
-                valueClass = ((ParameterizedType) types[i]).getRawType().getClass();
-            }
-            if (!params.get(i).getClass().isAssignableFrom(valueClass)) {
-                return false;
-            }
-        }
-        return true;
-    }
-    
-    
-    private List<Object> abstractParamsFromHeader(Element headerElement, Endpoint ep, Message message) {
-        List<Object> paramInHeader = new ArrayList<Object>();
-        List<Element> elemInHeader = new ArrayList<Element>();
-        for (BindingOperationInfo bop : ep.getEndpointInfo().getBinding().getOperations()) {
-            BindingMessageInfo bmi = isRequestor(message) ? bop.getOutput() : bop.getInput();
-            if (bmi == null) {
-                return paramInHeader;
-            }
-            List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
-            if (headers == null) {
-                return paramInHeader;
-            }
-            for (SoapHeaderInfo header : headers) {
-                MessagePartInfo mpi = header.getPart();
-                NodeList nodeList = headerElement.getChildNodes();
-                if (nodeList != null) {
-                    for (int i = 0; i < nodeList.getLength(); i++) {
-                        if (nodeList.item(i).getNamespaceURI().equals(
-                                mpi.getElementQName().getNamespaceURI())
-                                && nodeList.item(i).getLocalName().equals(
-                                        mpi.getElementQName().getLocalPart())) {
-                            Element param = (Element) nodeList.item(i);
-                            if (!elemInHeader.contains(param)) {
-                                elemInHeader.add(param);
-                            }
-                        }
-                    }
+    private Element findHeader(Element headerElement, MessagePartInfo mpi) {
+        NodeList nodeList = headerElement.getChildNodes();
+        Element param = null;
+        if (nodeList != null) {
+            QName name = mpi.getConcreteName();
+            for (int i = 0; i < nodeList.getLength(); i++) {
+                Node n = nodeList.item(i);
+                if (n.getNamespaceURI() != null 
+                        && n.getNamespaceURI().equals(name.getNamespaceURI())
+                        && n.getLocalName() != null
+                        && n.getLocalName().equals(name.getLocalPart())) {
+                    param = (Element) n;
                 }
             }
         }
-
-        for (Iterator iter = elemInHeader.iterator(); iter.hasNext();) {
-            Element element = (Element) iter.next();
-            paramInHeader.add(getNodeDataReader(message).read(element));
-        }
-        return paramInHeader;
+        return param;
     }
-
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Wed Dec 20 00:07:54 2006
@@ -20,7 +20,6 @@
 package org.apache.cxf.binding.soap.interceptor;
 
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.ResourceBundle;
 
@@ -32,7 +31,6 @@
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
-import org.apache.cxf.binding.soap.model.SoapBodyInfo;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataWriter;
@@ -110,58 +108,80 @@
         if (bop == null) {
             return endedHeader;
         }
+        
         XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);        
         boolean startedHeader = false;
-        List<MessagePartInfo> parts = new ArrayList<MessagePartInfo>();
-        BindingMessageInfo bmi = isRequestor(message) ? bop.getInput() : bop.getOutput();
+        BindingOperationInfo unwrappedOp = bop;
+        if (bop.isUnwrapped()) {
+            unwrappedOp = bop.getWrappedOperation();
+        }
+        boolean client = isRequestor(message);
+        BindingMessageInfo bmi = client ? unwrappedOp.getInput() : unwrappedOp.getOutput();
+        BindingMessageInfo wrappedBmi = client ? bop.getInput() : bop.getOutput();
+        
         if (bmi == null) {
             return endedHeader;
-        } else {
-            parts = bmi.getMessageInfo().getMessageParts();
-        } 
+        }
+        
+        List<MessagePartInfo> parts = wrappedBmi.getMessageInfo().getMessageParts();
         if (parts.size() > 0) {
             List<?> objs = message.getContent(List.class);
             if (objs == null) {
                 return endedHeader;
-            }            
-            Object[] args = objs.toArray();
+            }
             SoapVersion soapVersion = message.getVersion();
             List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
             if (headers == null) {
                 return endedHeader;
             }
+            
+            // This code is really ugly right now. Need to refactor...
+            int offset = 0;
+            int returnIdx = 0;
+            if (!client) {
+                for (int i = 0; i < parts.size(); i++) {
+                    MessagePartInfo part = parts.get(i);
+                    if (part.getIndex() == -1) {
+                        offset++;
+                        returnIdx = i;
+                        break;
+                    }
+                }
+            }
+            
             for (SoapHeaderInfo header : headers) {
-                Object arg = args[header.getSequence()];
+                MessagePartInfo part = header.getPart();
+
+                int idx = parts.indexOf(part);
+                if (!client && idx < returnIdx) {
+                    idx += offset;
+                }
+                
+                Object arg = objs.get(idx);
                 if (!(startedHeader || preexistingHeaders)) {
                     try {
                         xtw.writeStartElement(soapVersion.getPrefix(), 
                                               soapVersion.getHeader().getLocalPart(),
                                               soapVersion.getNamespace());
                     } catch (XMLStreamException e) {
-                        throw new SoapFault(
-                            new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), 
+                        throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), 
                             e, soapVersion.getSender());
                     }
                     startedHeader = true;
                 }
                 DataWriter<XMLStreamWriter> dataWriter = getDataWriter(message);
                 dataWriter.write(arg, header.getPart(), xtw);
+                
+                objs.remove(arg);
             }
-
-            for (MessagePartInfo part : parts) {
-                if (bmi.getExtensor(SoapBodyInfo.class) != null 
-                        && !bmi.getExtensor(SoapBodyInfo.class).getParts().contains(part)) {
-                    part.setProperty(MessagePartInfo.KEY_SKIPPED, Boolean.TRUE);
-                }
-            }
+            
             
             if (startedHeader || preexistingHeaders) {
                 try {
                     xtw.writeEndElement();
                     endedHeader = true;
                 } catch (XMLStreamException e) {
-                    throw new SoapFault(
-                        new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), 
+                    throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), 
                         e, soapVersion.getSender());
                 }
             }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java Wed Dec 20 00:07:54 2006
@@ -25,7 +25,6 @@
     
     private MessagePartInfo part;
     private String use;
-    private int sequence;
 
     public MessagePartInfo getPart() {
         return part;
@@ -41,13 +40,5 @@
 
     public void setUse(String use) {
         this.use = use;
-    }
-
-    public int getSequence() {
-        return sequence;
-    }
-
-    public void setSequence(int sequence) {
-        this.sequence = sequence;
     }
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml Wed Dec 20 00:07:54 2006
@@ -37,7 +37,7 @@
         <namespace>http://schemas.xmlsoap.org/wsdl/soap12/</namespace>        
     </extension>
     
-    <extension class="org.apache.cxf.binding.soap.SoapDestinationFactory" 
+    <extension class="org.apache.cxf.binding.soap.SoapTransportFactory" 
       interface="org.apache.cxf.transport.DestinationFactory" deferred="true">
         <namespace>http://schemas.xmlsoap.org/soap/</namespace>
         <namespace>http://schemas.xmlsoap.org/wsdl/soap/</namespace>

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension-soap.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension-soap.xml?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension-soap.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension-soap.xml Wed Dec 20 00:07:54 2006
@@ -41,7 +41,7 @@
         </property>
     </bean>
     
-    <bean class="org.apache.cxf.binding.soap.SoapDestinationFactory" lazy-init="true">
+    <bean class="org.apache.cxf.binding.soap.SoapTransportFactory" lazy-init="true">
         <property name="transportIds">
             <list>
                 <value>http://schemas.xmlsoap.org/soap/</value>

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java Wed Dec 20 00:07:54 2006
@@ -80,6 +80,7 @@
             bac = new BusApplicationContext(cfgFile, includeDefaults, context);           
         } catch (BeansException ex) {
             LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null);
+            throw new RuntimeException(ex);
         }
         
         bac.refresh();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Wed Dec 20 00:07:54 2006
@@ -20,7 +20,7 @@
 package org.apache.cxf.endpoint;
 
 import java.io.IOException;
-import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -64,7 +64,7 @@
     protected Endpoint endpoint;
     protected Conduit initedConduit;
     protected ClientOutFaultObserver outFaultObserver; 
-    protected int synchronousTimeout = 10000; // default 10 second timeout
+    protected int synchronousTimeout = 1000000; // default 10 second timeout
 
     public ClientImpl(Bus b, Endpoint e) {
         this(b, e, null);
@@ -208,7 +208,9 @@
         if (params == null) {
             message.setContent(List.class, Collections.emptyList());
         } else {
-            message.setContent(List.class, Arrays.asList(params));
+            List<Object> paramList = new ArrayList<Object>();
+            Collections.addAll(paramList, params);
+            message.setContent(List.class, paramList);
         }
     }
     

Copied: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/MethodDispatcher.java (from r488793, incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/MethodDispatcher.java?view=diff&rev=488948&p1=incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java&r1=488793&p2=incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/MethodDispatcher.java&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/frontend/MethodDispatcher.java Wed Dec 20 00:07:54 2006
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cxf.service.factory;
+package org.apache.cxf.frontend;
 
 import java.lang.reflect.Method;
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java Wed Dec 20 00:07:54 2006
@@ -189,6 +189,7 @@
             MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
             if (name.equals(p.getConcreteName())) {
                 exchange.put(BindingOperationInfo.class, boi);
+                exchange.put(OperationInfo.class, boi.getOperationInfo());
                 exchange.setOneWay(op.isOneWay());
                 return p;
             }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java Wed Dec 20 00:07:54 2006
@@ -126,6 +126,5 @@
             paramNum++;
         }
         message.setContent(List.class, parameters);
-        
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java Wed Dec 20 00:07:54 2006
@@ -50,13 +50,13 @@
 
         if (!isRequestor(message)) {
             if (operation.getOutput() != null) {
-                parts = operation.getOutput().getMessageInfo().getMessageParts();
+                parts = operation.getOutput().getMessageParts();
             } else {
                 // partial response to oneway
                 return;
             }
         } else {
-            parts = operation.getInput().getMessageInfo().getMessageParts();
+            parts = operation.getInput().getMessageParts();
         }
         countParts = parts.size();
 
@@ -67,12 +67,7 @@
                 Object[] els = parts.toArray();
 
                 for (int idx = 0; idx < countParts; idx++) {
-                    Object arg = args[idx];
-                    MessagePartInfo part = (MessagePartInfo)els[idx];
-                    if (part.getProperty(MessagePartInfo.KEY_SKIPPED) == null) {
-                        // not in header, write to soap body
-                        dataWriter.write(arg, part, message);
-                    }
+                    dataWriter.write(args[idx], (MessagePartInfo)els[idx], message);
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java Wed Dec 20 00:07:54 2006
@@ -36,10 +36,10 @@
 import org.apache.cxf.common.util.CollectionUtils;
 import org.apache.cxf.common.util.PrimitiveUtils;
 import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;

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=488948&r1=488947&r2=488948
==============================================================================
--- 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 Wed Dec 20 00:07:54 2006
@@ -25,11 +25,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.cxf.frontend.MethodDispatcher;
 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;
 
 /**

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=488948&r1=488947&r2=488948
==============================================================================
--- 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 Wed Dec 20 00:07:54 2006
@@ -108,6 +108,9 @@
         
         IOUtils.copy(is, os);
 
+        // TODO: shouldn't have to do this. IO caching needs cleaning
+        // up or possibly removal...
+        os.flush();
         is.close();
         os.close();
         

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Wed Dec 20 00:07:54 2006
@@ -22,6 +22,8 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.net.URI;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.util.Collection;
 import java.util.List;
 import java.util.logging.Logger;
@@ -375,14 +377,15 @@
         }
         String filePath = this.getClass().getResource("./s1/s2/s4/schema4.xsd").getFile();
         String importPath = schemaImport.getAttributeNode("schemaLocation").getValue();
-        if (!new URI(importPath).isAbsolute()) {
+        if (!new URI(URLEncoder.encode(importPath, "utf-8")).isAbsolute()) {
             schemaImport.getAttributeNode("schemaLocation").setNodeValue("file:" + filePath);            
             String fileStr = this.getClass().getResource("./s1/s2/schema2.xsd").getFile();
+            fileStr = URLDecoder.decode(fileStr, "utf-8");
             File file = new File(fileStr);
             if (file.exists()) {
                 file.delete();
             }
-            FileOutputStream fout = new FileOutputStream(fileStr);
+            FileOutputStream fout = new FileOutputStream(file);
             XMLUtils.writeTo(doc, fout);
             fout.flush();
             fout.close();

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncCallbackFuture.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncCallbackFuture.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncCallbackFuture.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/AsyncCallbackFuture.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,116 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+
+
+package org.apache.cxf.jaxws;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+
+public class AsyncCallbackFuture implements Runnable, Future {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(AsyncCallbackFuture.class);
+    private final Response response;
+    private final AsyncHandler callback; 
+    private boolean done;
+    
+    public AsyncCallbackFuture(Response r, AsyncHandler c) {
+        response = r;
+        callback = c;  
+    }
+   
+    @SuppressWarnings("unchecked")
+    public synchronized void run() { 
+        try {
+            callback.handleResponse(response);            
+        } finally {
+            done = true;
+            notifyAll();
+        }
+    }
+     
+    public boolean cancel(boolean interrupt) {
+        return response.cancel(interrupt);     
+    }
+    
+    public boolean isCancelled() {
+        return response.isCancelled(); 
+    }
+
+    public boolean isDone() {
+        return done;
+    }
+
+    public Object get() throws InterruptedException, ExecutionException {
+        waitForCallbackExecutionToFinish();      
+        return null;
+    }
+
+    
+    public Object get(long timeout, TimeUnit unit)
+        throws InterruptedException, ExecutionException, TimeoutException {
+        long ms = TimeUnit.MILLISECONDS.convert(timeout, unit);
+        waitForCallbackExecutionToFinish(ms);
+        return null;
+    }
+    
+    private synchronized void waitForCallbackExecutionToFinish() {       
+        while (!done) {
+            LOG.fine("waiting for callback to finish execution.");
+            try {
+                wait();
+            } catch (InterruptedException ex) {
+                // deliberately ignore 
+            }
+        }
+    }
+    
+    private synchronized void waitForCallbackExecutionToFinish(long millis) throws TimeoutException {       
+        while (!done && millis > 0) {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("waiting (max " + millis
+                         + " milliseconds for callback to finish execution (max .");
+            }
+            long startedAt = System.currentTimeMillis(); 
+            try {
+                wait(millis);
+            } catch (InterruptedException ex) {
+                // deliberately ignore
+                millis -= System.currentTimeMillis() - startedAt;
+            }
+        }
+        if (!done) {
+            throw new TimeoutException(new Message("ASYNC_HANDLER_TIMEDOUT_EXC",
+                                                                    LOG).toString());
+        }
+    }
+
+
+}

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Wed Dec 20 00:07:54 2006
@@ -42,6 +42,7 @@
 import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingInfoFactoryBean;
 import org.apache.cxf.jaxws.context.WebContextResourceResolver;
 import org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder;
+import org.apache.cxf.jaxws.support.AbstractJaxWsServiceFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
@@ -52,8 +53,6 @@
 import org.apache.cxf.resource.ResourceResolver;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.service.factory.ServerFactoryBean;
 
 public class EndpointImpl extends javax.xml.ws.Endpoint {
     private static final Logger LOG = LogUtils.getL7dLogger(JaxWsServiceFactoryBean.class);
@@ -65,7 +64,7 @@
     private Server server;
     private Service service;
     private JaxWsImplementorInfo implInfo;
-    private ReflectionServiceFactoryBean serviceFactory;
+    private AbstractJaxWsServiceFactoryBean serviceFactory;
 
     private String bindingURI;
     
@@ -102,6 +101,7 @@
         configureObject(service);
         
         service.put(Message.SCHEMA_VALIDATION_ENABLED, service.getEnableSchemaValidationForAllPort());
+        
         if (implInfo.isWebServiceProvider()) {
             service.setInvoker(new ProviderInvoker((Provider<?>)i));
         } else {
@@ -200,11 +200,12 @@
 
     protected void doPublish(String address) {
 
-        ServerFactoryBean svrFactory = new ServerFactoryBean();
+        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
         svrFactory.setBus(bus);
         svrFactory.setAddress(address);
         svrFactory.setServiceFactory(serviceFactory);
         svrFactory.setStart(false);
+        svrFactory.setServiceBean(implementor);
         configureObject(svrFactory);
         
         // TODO: Replace with discovery mechanism!!

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSAsyncCallable.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSAsyncCallable.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSAsyncCallable.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSAsyncCallable.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+package org.apache.cxf.jaxws;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+public class JAXWSAsyncCallable implements Callable<Object> {
+
+    private ClientProxy endPointInvocationHandler;
+    private Method method;
+    private BindingOperationInfo oi; 
+    private Object[] params;
+    private Map<String, Object> context;
+    
+    public JAXWSAsyncCallable(ClientProxy endPointInvocationHandler,
+                              Method method,
+                              BindingOperationInfo oi,
+                              Object[] params,
+                              Map<String, Object> cxt) {
+        this.endPointInvocationHandler = endPointInvocationHandler;
+        this.method = method;
+        this.oi = oi;
+        this.params = params;
+        this.context = cxt;        
+    }
+    
+    public Object call() throws Exception {
+        return endPointInvocationHandler.invokeSync(method, oi, params, context);
+    }
+
+}



Mime
View raw message