cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r469089 [1/2] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ common/common/src/main/java/org/apache/cxf/common/util/ common/common/src/test/java/org/apache/cxf/common/util/ rt/bi...
Date Mon, 30 Oct 2006 08:26:49 GMT
Author: mmao
Date: Mon Oct 30 00:26:47 2006
New Revision: 469089

URL: http://svn.apache.org/viewvc?view=rev&rev=469089
Log:
CXF-159 Soap1.2 support HTTP GET

* Added soap12 namespaces for all the soap12 fault node
* Passthrough the interceptors when it's HTTP GET, to boost the speed.
* SOAP11,SOAP12,XMLBinding now all support HTTP GET (support both DOC/Lit, RPC)
* System tests for HTTP GET feature, add demos later.
* Set the content-type in Message.ProtocolHead, but can get from Message.ContentType as well.
  correct the fault message's content-type
* Added calculator service for GET test. (primitive type)
* Added soapbinding unit test for content-type etc.




Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java   (with props)
    incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java   (with props)
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java   (with props)
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/calculator/
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/calculator/CalculatorImpl.java   (with props)
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/calculator.wsdl   (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
    incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/URIParameterInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.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/interceptor/MultipartMessageInterceptor.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/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.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/XMLMessageInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainIntiatorObserver.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/OutgoingChainSetupInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/common/ClientServerTestBase.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLBareTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
    incubator/cxf/trunk/testutils/pom.xml

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java Mon Oct 30 00:26:47 2006
@@ -48,6 +48,7 @@
     String MTOM_ENABLED = Message.class.getName() + ".isMtomEnabled";
     String SCHEMA_VALIDATION_ENABLED = Message.class.getCanonicalName() + ".schemaValidationEnabled";
     String CONTENT_TYPE = Message.class.getName() + ".ContentType";
+    String BASE_PATH = Message.class.getName() + ".BASE_PATH";
 
     String getId();
     void setId(String id);

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java Mon Oct 30 00:26:47 2006
@@ -22,6 +22,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.cxf.message.Message;
 
 public abstract class AbstractPhaseInterceptor<T extends Message> implements PhaseInterceptor<T> {
@@ -82,5 +84,10 @@
     }
 
     public void handleFault(T message) {
+    }
+    
+    public boolean isGET(T message) {
+        String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
+        return "GET".equals(method) && message.getContent(XMLStreamReader.class) == null;
     }
 }

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 30 00:26:47 2006
@@ -200,7 +200,7 @@
     private void unwind(Message message) {
         while (iterator.hasPrevious()) {
             Interceptor currentInterceptor = iterator.previous();
-            if (LOG.isLoggable(Level.FINE)) {
+            if (LOG.isLoggable(Level.INFO)) {
                 LOG.fine("Invoking handleFault on interceptor " + currentInterceptor);
             }
             currentInterceptor.handleFault(message);

Added: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java?view=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java (added)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,57 @@
+/**
+ * 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.common.util;
+
+public final class PrimitiveUtils {
+    
+    private PrimitiveUtils() {
+        
+    }
+
+    public static Object read(String value, Class type) {
+        Object ret = value;
+        if (Integer.TYPE.equals(type)) {
+            ret = Integer.valueOf(value);
+        }
+        if (Byte.TYPE.equals(type)) {
+            ret = Byte.valueOf(value);
+        }
+        if (Short.TYPE.equals(type)) {
+            ret = Short.valueOf(value);
+        }
+        if (Long.TYPE.equals(type)) {
+            ret = Long.valueOf(value);
+        }
+        if (Float.TYPE.equals(type)) {
+            ret = Float.valueOf(value);
+        }
+        if (Double.TYPE.equals(type)) {
+            ret = Double.valueOf(value);
+        }
+        if (Boolean.TYPE.equals(type)) {
+            ret = Boolean.valueOf(value);
+        }
+        if (Character.TYPE.equals(type)) {
+            ret = value.charAt(0);
+        }
+        // TODO others.
+        return ret;
+    }
+}

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/PrimitiveUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java Mon Oct 30 00:26:47 2006
@@ -68,6 +68,19 @@
         }
         return true;
     }
+    
+    public static String trim(String target, String token) {
+        int tokenLength = token.length();
+        int targetLength = target.length();
+        
+        if (target.startsWith(token)) {            
+            return trim(target.substring(tokenLength), token);
+        }
+        if (target.endsWith(token)) {            
+            return trim(target.substring(0, targetLength - tokenLength), token);
+        }
+        return target;
+    }
 
     public static boolean isEqualUri(String uri1, String uri2) {
 

Added: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java?view=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java (added)
+++ incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,29 @@
+/**
+ * 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.common.util;
+
+import junit.framework.TestCase;
+
+public class StringUtilsTest extends TestCase {
+    public void testTrim() throws Exception {
+        String target = "////soapport///";
+        assertEquals("soapport", StringUtils.trim(target, "/"));
+    }
+}

Propchange: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/URIParameterInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/URIParameterInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/URIParameterInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/URIParameterInterceptor.java Mon Oct 30 00:26:47 2006
@@ -22,6 +22,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -43,7 +44,7 @@
 import org.apache.ws.commons.schema.XmlSchemaElement;
 
 public class URIParameterInterceptor extends AbstractPhaseInterceptor<Message> {
-
+    private static final Logger LOG = Logger.getLogger(URIParameterInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(URIParameterInterceptor.class);
 
     public URIParameterInterceptor() {
@@ -55,8 +56,11 @@
     public void handleMessage(Message message) {
         String path = (String)message.get(Message.PATH_INFO);
         String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
-        String contentType = (String)message.get(HttpConstants.CONTENT_TYPE);
+        String contentType = (String)message.get(Message.CONTENT_TYPE);
 
+        LOG.info("URIParameterInterceptor handle message on path [" + path 
+                 + "] with Content-Type ["  + contentType + "]");
+        
         BindingOperationInfo op = message.getExchange().get(BindingOperationInfo.class);
 
         URIMapper mapper = (URIMapper)message.getExchange().get(Service.class).get(URIMapper.class.getName());
@@ -81,6 +85,8 @@
         if ("application/x-www-form-urlencoded.".equals(contentType)) {
             params = IriDecoderHelper.decode(path, location, message.getContent(InputStream.class));
         } else if ("application/xml".equals(contentType)) {
+            params = IriDecoderHelper.decodeIri(path, location);
+        } else if ("text/xml".equals(contentType)) {
             params = IriDecoderHelper.decodeIri(path, location);
         } else if ("multipart/form-data".equals(contentType)) {
             // TODO

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java Mon Oct 30 00:26:47 2006
@@ -48,13 +48,15 @@
         return createMessage(new MessageImpl());
     }
 
+    @SuppressWarnings("unchecked")
     public Message createMessage(Message m) {
         SoapMessage soapMessage = new SoapMessage(m);
         soapMessage.setVersion(version);
+
         soapMessage.put(Message.CONTENT_TYPE, version.getContentType());
 
         if (mtomEnabled) {
-            m.put(Message.MTOM_ENABLED, Boolean.TRUE);
+            soapMessage.put(Message.MTOM_ENABLED, Boolean.TRUE);
         }
         return soapMessage;
     }

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 30 00:26:47 2006
@@ -60,6 +60,7 @@
 import org.apache.cxf.interceptor.BareOutInterceptor;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.apache.cxf.interceptor.StaxOutInterceptor;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.interceptor.WrappedInInterceptor;
 import org.apache.cxf.interceptor.WrappedOutInterceptor;
 import org.apache.cxf.service.model.BindingInfo;
@@ -181,6 +182,7 @@
             sb.getOutInterceptors().add(new BareOutInterceptor());
         }
         
+        sb.getInInterceptors().add(new URIMappingInterceptor());
         return sb;
     }
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MultipartMessageInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MultipartMessageInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MultipartMessageInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MultipartMessageInterceptor.java Mon Oct 30 00:26:47 2006
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
+import java.util.logging.Logger;
+
 import org.apache.cxf.binding.attachment.AttachmentDeserializer;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -29,6 +31,7 @@
     public static final String ATTACHMENT_DIRECTORY = "attachment-directory";
     public static final String ATTACHMENT_MEMORY_THRESHOLD = "attachment-memory-threshold";
     public static final int THRESHHOLD = 1024 * 100;
+    private static final Logger LOG = Logger.getLogger(MultipartMessageInterceptor.class.getName());
 
     /**
      * contruct the soap message with attachments from mime input stream
@@ -42,7 +45,10 @@
     }
     
     public void handleMessage(Message message) {
-        
+        if (isGET(message)) {
+            LOG.info("MultipartMessageInterceptor skipped in HTTP GET method");
+            return;
+        }
         AttachmentDeserializer ad = new AttachmentDeserializer(message);
         if (ad.preprocessMessage()) {
             message.put(AttachmentDeserializer.class, ad);

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 Mon Oct 30 00:26:47 2006
@@ -21,6 +21,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 
@@ -29,6 +30,7 @@
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -40,9 +42,12 @@
 
 public class RPCInInterceptor extends AbstractInDatabindingInterceptor {
 
+    private static final Logger LOG = Logger.getLogger(RPCInInterceptor.class.getName());
+    
     public RPCInInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
+        addAfter(URIMappingInterceptor.class.getName());
     }
 
     private BindingOperationInfo getOperation(Message message, QName opName) {
@@ -50,6 +55,10 @@
     }
 
     public void handleMessage(Message message) {
+        if (isGET(message)) {
+            LOG.info("RPCInInterceptor skipped in HTTP GET method");
+            return;
+        }
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
 
         BindingOperationInfo operation = null;

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 Mon Oct 30 00:26:47 2006
@@ -21,6 +21,7 @@
 
 import java.io.InputStream;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
@@ -42,6 +43,7 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class ReadHeadersInterceptor extends AbstractSoapInterceptor {
+    private static final Logger LOG = Logger.getLogger(ReadHeadersInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ReadHeadersInterceptor.class);
 
     public ReadHeadersInterceptor() {
@@ -50,7 +52,10 @@
     }
 
     public void handleMessage(SoapMessage message) {
-        
+        if (isGET(message)) {
+            LOG.info("ReadHeadersInterceptor skipped in HTTP GET method");
+            return;
+        }
         XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
         
         if (xmlReader == null) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java Mon Oct 30 00:26:47 2006
@@ -61,40 +61,40 @@
 
         XMLStreamReader reader = message.getContent(XMLStreamReader.class);
         Map<String, String> ns = new HashMap<String, String>();
-        ns.put("soap12", Soap12.SOAP_NAMESPACE);
+        ns.put("s", Soap12.SOAP_NAMESPACE);
         XPathUtils xu = new XPathUtils(ns);        
         
         try {
             Document fault = StaxUtils.read(new FragmentStreamReader(reader));
-            String faultCodeString = (String) xu.getValue("//soap12:Fault/Code/Value/text()", 
+            String faultCodeString = (String) xu.getValue("//s:Fault/s:Code/s:Value/text()", 
                                                         fault, 
                                                         XPathConstants.STRING);
             
             faultCode = XMLUtils.getQName(faultCodeString, fault);
             
-            String subCodeString = (String) xu.getValue("//soap12:Fault/Code/Subcode/Value/text()", 
+            String subCodeString = (String) xu.getValue("//s:Fault/s:Code/s:Subcode/s:Value/text()", 
                                                         fault,
                                                         XPathConstants.STRING);
             if (StringUtils.isEmpty(subCodeString)) {
                 subCode = XMLUtils.getQName(subCodeString, fault);
             }
             
-            exMessage = (String) xu.getValue("//soap12:Fault/Reason/Text/text()", 
+            exMessage = (String) xu.getValue("//s:Fault/s:Reason/s:Text/text()", 
                                              fault,
                                              XPathConstants.STRING);
             
-            Node detailNode = (Node) xu.getValue("//soap12:Fault/Detail",
+            Node detailNode = (Node) xu.getValue("//s:Fault/s:Detail",
                                                  fault,
                                                  XPathConstants.NODE);
             if (detailNode != null) {
                 detail = (Element) detailNode;
             }
             
-            role = (String) xu.getValue("//soap12:Fault/Role/text()", 
+            role = (String) xu.getValue("//s:Fault/s:Role/text()", 
                                         fault,
                                         XPathConstants.STRING);
 
-            node = (String) xu.getValue("//soap12:Fault/Node/text()", 
+            node = (String) xu.getValue("//s:Fault/s:Node/text()", 
                                         fault,
                                         XPathConstants.STRING);                       
         } catch (XMLStreamException e) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java Mon Oct 30 00:26:47 2006
@@ -21,6 +21,7 @@
 
 import java.util.Map;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -34,10 +35,12 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class Soap12FaultOutInterceptor extends AbstractSoapInterceptor {
+    private static final Logger LOG = Logger.getLogger(URIMappingInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(Soap12FaultOutInterceptor.class);
 
     public Soap12FaultOutInterceptor() {
@@ -46,6 +49,7 @@
     }
 
     public void handleMessage(SoapMessage message) throws Fault {
+        LOG.info(getClass() + (String) message.get(SoapMessage.CONTENT_TYPE));
         message.put(org.apache.cxf.message.Message.RESPONSE_CODE, new Integer(500));
         
         XMLStreamWriter writer = message.getContent(XMLStreamWriter.class);
@@ -64,23 +68,23 @@
 
             writer.writeStartElement(defaultPrefix, "Fault", ns);
 
-            writer.writeStartElement("Code");
-            writer.writeStartElement("Value");
+            writer.writeStartElement(defaultPrefix, "Code", ns);
+            writer.writeStartElement(defaultPrefix, "Value", ns);
        
             writer.writeCharacters(fault.getCodeString(getFaultCodePrefix(writer, fault.getFaultCode()), 
                                                        defaultPrefix));
             writer.writeEndElement();
             
             if (fault.getSubCode() != null) {
-                writer.writeStartElement("Subcode");
+                writer.writeStartElement(defaultPrefix, "Subcode", ns);
                 writer.writeCharacters(fault.getSubCodeString(getFaultCodePrefix(writer, fault.getSubCode()), 
                                                               defaultPrefix));                
                 writer.writeEndElement();
             }
             writer.writeEndElement();
 
-            writer.writeStartElement("Reason");
-            writer.writeStartElement("Text");
+            writer.writeStartElement(defaultPrefix, "Reason", ns);
+            writer.writeStartElement(defaultPrefix, "Text", ns);
             writer.writeAttribute("xml", "http://www.w3.org/XML/1998/namespace", "lang ", getLangCode());
             if (fault.getMessage() != null) {
                 writer.writeCharacters(fault.getMessage());
@@ -92,7 +96,7 @@
 
             if (fault.hasDetails()) {
                 Element detail = fault.getDetail();
-                writer.writeStartElement("Detail");
+                writer.writeStartElement(defaultPrefix, "Detail", ns);
 
                 NodeList details = detail.getChildNodes();
                 for (int i = 0; i < details.getLength(); i++) {

Added: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java?view=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,47 @@
+/**
+ * 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.binding.soap;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+
+public class SoapBindingTest extends TestCase {
+    
+    @SuppressWarnings("unchecked")
+    public void testCreateMessage() throws Exception {
+        Message message = new MessageImpl();
+        SoapBinding sb = new SoapBinding();
+        message = sb.createMessage(message);
+        assertNotNull(message);
+        assertTrue(message instanceof SoapMessage);
+        SoapMessage soapMessage = (SoapMessage) message;
+        assertEquals(Soap11.getInstance(), soapMessage.getVersion());
+
+        assertEquals("text/xml", soapMessage.get(Message.CONTENT_TYPE));
+        
+        sb.setSoapVersion(Soap12.getInstance());
+        soapMessage = (SoapMessage) sb.createMessage(soapMessage);
+        assertEquals(Soap12.getInstance(), soapMessage.getVersion());     
+        assertEquals("application/soap+xml", soapMessage.get(Message.CONTENT_TYPE));
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java Mon Oct 30 00:26:47 2006
@@ -105,10 +105,14 @@
 
         Document faultDoc = DOMUtils.readXml(new ByteArrayInputStream(out.toByteArray()));
         
-        assertValid("//soap12env:Fault/Code/Value[text()='ns1:Sender']", faultDoc);
-        assertValid("//soap12env:Fault/Code/Subcode[text()='ns2:invalidsoap']", faultDoc);
-        assertValid("//soap12env:Fault/Reason/Text[@xml:lang='en']", faultDoc);
-        assertValid("//soap12env:Fault/Reason/Text[text()='" + faultString + "']", faultDoc);
+        assertValid("//soap12env:Fault/soap12env:Code/soap12env:Value[text()='ns1:Sender']", 
+                    faultDoc);
+        assertValid("//soap12env:Fault/soap12env:Code/soap12env:Subcode[text()='ns2:invalidsoap']", 
+                    faultDoc);
+        assertValid("//soap12env:Fault/soap12env:Reason/soap12env:Text[@xml:lang='en']", 
+                    faultDoc);
+        assertValid("//soap12env:Fault/soap12env:Reason/soap12env:Text[text()='" + faultString + "']", 
+                    faultDoc);
 
         XMLStreamReader reader = StaxUtils.createXMLStreamReader(new ByteArrayInputStream(out.toByteArray()));
         m.setContent(XMLStreamReader.class, reader);
@@ -120,8 +124,8 @@
 
         SoapFault fault2 = (SoapFault)m.getContent(Exception.class);
         assertNotNull(fault2);
-        assertEquals(fault.getMessage(), fault2.getMessage());
         assertEquals(Soap12.getInstance().getSender(), fault2.getFaultCode());
+        assertEquals(fault.getMessage(), fault2.getMessage());        
     }
     
 }

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 30 00:26:47 2006
@@ -35,6 +35,7 @@
 import org.apache.cxf.binding.xml.interceptor.XMLMessageOutInterceptor;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.apache.cxf.interceptor.StaxOutInterceptor;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.service.model.BindingInfo;
 
 public class XMLBindingFactory extends AbstractBindingFactory {
@@ -85,6 +86,8 @@
         
         xb.getOutFaultInterceptors().add(new StaxOutInterceptor());
         xb.getOutFaultInterceptors().add(new XMLFaultOutInterceptor());
+        
+        xb.getInInterceptors().add(new URIMappingInterceptor());
 
         return xb;
     }

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java Mon Oct 30 00:26:47 2006
@@ -23,6 +23,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
@@ -47,7 +48,7 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class XMLMessageInInterceptor extends AbstractInDatabindingInterceptor {
-
+    private static final Logger LOG = Logger.getLogger(XMLMessageInInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(XMLMessageInInterceptor.class);
     
     // TODO: this should be part of the chain!!
@@ -60,8 +61,14 @@
     }
 
     public void handleMessage(Message message) throws Fault {
+        if (isGET(message)) {            
+            LOG.info("XMLMessageInInterceptor skipped in HTTP GET method");
+            return;
+        }
         XMLStreamReader xsr = message.getContent(XMLStreamReader.class);
+        
         DepthXMLStreamReader reader = new DepthXMLStreamReader(xsr);
+        
         Endpoint ep = message.getExchange().get(Endpoint.class);
         BindingInfo service = ep.getEndpointInfo().getBinding();
         

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainIntiatorObserver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainIntiatorObserver.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainIntiatorObserver.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractFaultChainIntiatorObserver.java Mon Oct 30 00:26:47 2006
@@ -43,6 +43,7 @@
         this.bus = bus;
     }
 
+    @SuppressWarnings("unchecked")
     public void onMessage(Message m) {
         Message faultMessage = m.getExchange().getFaultMessage();
         if (faultMessage == null) {
@@ -51,7 +52,9 @@
         
         faultMessage = m.getExchange().get(Binding.class).createMessage(faultMessage);
         m.getExchange().setFaultMessage(faultMessage);
+        m.putAll(faultMessage);
         faultMessage.putAll(m);
+
         MessageImpl.copyContent(m, faultMessage);
         
         Exception e = m.getContent(Exception.class);
@@ -84,4 +87,4 @@
     public Bus getBus() {
         return bus;
     }
-}
\ No newline at end of file
+}

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 Mon Oct 30 00:26:47 2006
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 
@@ -47,7 +48,7 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class BareInInterceptor extends AbstractInDatabindingInterceptor {
-
+    private static final Logger LOG = Logger.getLogger(BareInInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(BareInInterceptor.class);
 
     private static Set<String> filter = new HashSet<String>();
@@ -60,9 +61,15 @@
     public BareInInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
+        addAfter(URIMappingInterceptor.class.getName());
     }
 
     public void handleMessage(Message message) {
+        if (isGET(message) && message.getContent(List.class) != null) {  
+            LOG.info("BareInInterceptor skipped in HTTP GET method");
+            return;
+        }        
+
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
         Exchange exchange = message.getExchange();
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java Mon Oct 30 00:26:47 2006
@@ -19,7 +19,14 @@
 
 package org.apache.cxf.interceptor;
 
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -33,7 +40,7 @@
  * @author Dan Diephouse
  */
 public class OutgoingChainSetupInterceptor extends AbstractPhaseInterceptor<Message> {
-
+    private static final Logger LOG = Logger.getLogger(OutgoingChainSetupInterceptor.class.getName());
     public OutgoingChainSetupInterceptor() {
         super();
         setPhase(Phase.PRE_LOGICAL);
@@ -52,14 +59,36 @@
             outMessage = ep.getBinding().createMessage();
             ex.setOutMessage(outMessage);
         }
+        setUpContentType(outMessage);
 
         Message faultMessage = message.getExchange().getFaultMessage();
         if (faultMessage == null) {
-            faultMessage = ep.getBinding().createMessage();
+            faultMessage = ep.getBinding().createMessage();            
             ex.setFaultMessage(faultMessage);
         }
+
+        setUpContentType(faultMessage);
         
         outMessage.setInterceptorChain(getOutInterceptorChain(ex));
+    }
+    
+    @SuppressWarnings("unchecked")
+    private void setUpContentType(Message message) {
+        if (StringUtils.isEmpty((String)message.get(Message.CONTENT_TYPE))) {
+            return;
+        }
+        
+        Map<String, List<String>> headers = (Map<String, List<String>>)message.get(Message.PROTOCOL_HEADERS);
+        if (headers == null) {
+            headers = new HashMap<String, List<String>>();
+            message.put(Message.PROTOCOL_HEADERS, headers);         
+        }
+        
+        LOG.info("OutgoingChainSetupInterceptor set the content-type to: " 
+                 + message.get(Message.CONTENT_TYPE));
+
+        headers.put("Content-Type",  
+                    Arrays.asList(new String[] {(String)message.get(Message.CONTENT_TYPE)}));
     }
     
     public static InterceptorChain getOutInterceptorChain(Exchange ex) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java Mon Oct 30 00:26:47 2006
@@ -23,6 +23,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -40,6 +41,8 @@
  */
 public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(StaxInInterceptor.class);
+    private static final Logger LOG = Logger.getLogger(StaxInInterceptor.class.getName());    
+
     private static Map<Object, XMLInputFactory> factories = new HashMap<Object, XMLInputFactory>();
 
     public StaxInInterceptor() {
@@ -48,6 +51,10 @@
     }
 
     public void handleMessage(Message message) {
+        if (isGET(message)) {
+            LOG.info("StaxInInterceptor skipped in HTTP GET method");
+            return;
+        }
         InputStream is = message.getContent(InputStream.class);
         assert is != null;
 

Added: 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=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,156 @@
+/**
+ * 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.interceptor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.util.PrimitiveUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+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.ServiceModelUtil;
+
+public class URIMappingInterceptor extends AbstractInDatabindingInterceptor {
+    
+    private static final Logger LOG = Logger.getLogger(URIMappingInterceptor.class.getName());
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(URIMappingInterceptor.class);
+    
+    public URIMappingInterceptor() {
+        super();
+        setPhase(Phase.UNMARSHAL);
+    }
+
+    public void handleMessage(Message message) throws Fault {
+        String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
+        LOG.info("Invoking HTTP method " + method);
+        BindingOperationInfo op = message.getExchange().get(BindingOperationInfo.class);
+        if (!"GET".equalsIgnoreCase(method)) {
+            return;
+        }
+        if (op != null) {
+            return;
+        }
+        String opName = getOperationName(message);
+        LOG.info("URIMappingInterceptor get operation: " + opName);
+        op = ServiceModelUtil.getOperation(message.getExchange(), opName);
+        
+        if (op == null || opName == null || op.getName() == null
+            || StringUtils.isEmpty(op.getName().getLocalPart())
+            || !opName.equals(op.getName().getLocalPart())) {
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION", BUNDLE, opName));
+        }
+        message.getExchange().put(BindingOperationInfo.class, op);
+        message.setContent(List.class, getParameters(message, op));
+    }
+
+    protected List<Object> getParameters(Message message, BindingOperationInfo operation) {
+        List<Object> parameters = new ArrayList<Object>();
+        MessageInfo msg = operation.getOperationInfo().getInput();
+        int idx = parameters.size();
+
+        Map<String, String> queries = getQueries(message);
+        for (String key : queries.keySet()) {
+            MessagePartInfo p = msg.getMessageParts().get(idx);
+            if (p == null) {
+                LOG.warning("URIMappingInterceptor MessagePartInfo NULL ");
+                throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, 
+                                                                       "index: " + idx + " on key " + key));
+            }
+
+            // TODO check the parameter name here
+            Object param = null;
+            Class type = (Class)p.getProperty(Class.class.getName());
+            
+            if (type != null && type.isPrimitive()) {
+                param = PrimitiveUtils.read(queries.get(key), type);
+            } else {
+                param = queries.get(key);
+            }
+            if (param != null) {
+                parameters.add(param);
+            } else {
+                throw new RuntimeException(p.getName() + " can not be unmarshalled");
+            }
+        }        
+        return parameters;
+    }
+
+    protected Map<String, String> getQueries(Message message) {
+        Map<String, String> queries = new LinkedHashMap<String, String>();
+        String query = (String)message.get(Message.QUERY_STRING);   
+        if (!StringUtils.isEmpty(query)) {
+            List<String> parts = Arrays.asList(query.split("&"));
+            for (String part : parts) {
+                String[] keyValue = part.split("=");
+                queries.put(keyValue[0], keyValue[1]);
+            }
+            return queries;
+        }
+
+        String path = (String)message.get(Message.PATH_INFO);
+        String basePath = getBasePath(message);
+        List<String> parts = Arrays.asList(path.split("/"));
+        int baseIndex = parts.indexOf(basePath);
+        if (baseIndex + 2 > parts.size()) {
+            return null;
+        }
+        for (int i = baseIndex + 2; i < parts.size(); i += 2) {
+            if (i + 1 > parts.size()) {
+                queries.put(parts.get(i), null);
+            }
+            queries.put(parts.get(i), parts.get(i + 1));
+        }
+        return queries;
+    }
+    
+    private String getBasePath(Message message) {
+        String basePath = (String)message.get(Message.BASE_PATH);     
+        return StringUtils.trim(basePath, "/");
+    }
+
+    protected String getOperationName(Message message) {
+        String path = (String)message.get(Message.PATH_INFO);
+
+        String basePath = getBasePath(message);
+
+        List<String> parts = Arrays.asList(path.split("/"));
+
+        int baseIndex = parts.indexOf(basePath);
+        if (baseIndex + 1 > parts.size()) {
+            return null;
+        }
+        String opName = parts.get(baseIndex + 1);
+        if (opName.indexOf("?") != -1) {
+            opName = opName.split("\\?")[0];
+        }
+
+        return opName;
+    }
+}

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java Mon Oct 30 00:26:47 2006
@@ -23,6 +23,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
+import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamConstants;
 
@@ -39,14 +40,21 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class WrappedInInterceptor extends AbstractInDatabindingInterceptor {
+    private static final Logger LOG = Logger.getLogger(WrappedInInterceptor.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedInInterceptor.class);
 
     public WrappedInInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
+        addAfter(URIMappingInterceptor.class.getName());
     }
 
     public void handleMessage(Message message) {
+        if (isGET(message) && message.getContent(List.class) != null) {
+            LOG.info("XMLMessageInInterceptor skipped in HTTP GET method");
+            return;
+        }
+        
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
 
         // Trying to find the operation name from the XML.

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 30 00:26:47 2006
@@ -58,7 +58,10 @@
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object> params) {
         Object res;
         try {
-            Object[] paramArray = params.toArray();
+            Object[] paramArray = new Object[]{};
+            if (params != null) {
+                paramArray = params.toArray();
+            }
             
             insertExchange(m, paramArray, exchange);
             

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java?view=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,122 @@
+/**
+ * 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.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.SoapBindingFactory;
+import org.apache.cxf.calculator.CalculatorImpl;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.test.AbstractCXFTest;
+
+public class URIMappingInterceptorDocLitTest extends AbstractCXFTest {
+    
+    Message message;
+    String ns = "http://apache.org/cxf/calculator";
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        BindingFactoryManager bfm = getBus().getExtension(BindingFactoryManager.class);
+        bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", 
+                                   new SoapBindingFactory());
+        
+        message = new MessageImpl();
+        message.put(Message.HTTP_REQUEST_METHOD, "GET");
+        message.put(Message.BASE_PATH, "SoapPort");
+        
+        Exchange exchange = new ExchangeImpl();
+        message.setExchange(exchange);        
+
+
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        URL resource = getClass().getResource("/wsdl/calculator.wsdl");
+        assertNotNull(resource);
+        bean.setWsdlURL(resource);
+        bean.setBus(getBus());
+        bean.setServiceClass(CalculatorImpl.class);
+        CalculatorImpl calculator = new CalculatorImpl();
+        BeanInvoker invoker = new BeanInvoker(calculator);
+        bean.setInvoker(invoker);
+
+        Service service = bean.create();
+        
+        EndpointInfo endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "CalculatorPort"));
+        Endpoint endpoint = new EndpointImpl(getBus(), service, endpointInfo);
+        exchange.put(Endpoint.class, endpoint);
+    }
+    
+    public void testGetAddFromPath() throws Exception {
+        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add/arg0/1/arg1/2");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        
+        Object parameters = message.getContent(List.class);
+        assertNotNull(parameters);
+        assertEquals(2, ((List)parameters).size());
+        // TODO: should return int, service factory is broken, check it later.
+        //        Integer value = (Integer) ((List)parameters).get(0);
+        //        assertEquals(1, value.intValue());
+        //        
+        //        value = (Integer) ((List)parameters).get(1);        
+        //        assertEquals(2, value.intValue());
+        
+        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        assertNotNull(boi);
+        assertEquals(new QName(ns, "add"), boi.getName());
+    }
+    
+    public void testGetAddFromQuery() throws Exception {
+        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add");
+        message.put(Message.QUERY_STRING, "?arg0=1&arg0=2");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        
+        Object parameters = message.getContent(List.class);
+        assertNotNull(parameters);
+        assertEquals(2, ((List)parameters).size());
+        
+        // TODO: should return int
+        //        Integer value = (Integer) ((List)parameters).get(0);       
+        //        assertEquals(1, value.intValue());
+        //        value = (Integer) ((List)parameters).get(1);
+        //        assertEquals(2, value.intValue());
+    }
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java?view=auto&rev=469089
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java Mon Oct 30 00:26:47 2006
@@ -0,0 +1,125 @@
+/**
+ * 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.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.SoapBindingFactory;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.interceptor.URIMappingInterceptor;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.hello_world_soap_http.RPCLitGreeterImpl;
+
+public class URIMappingInterceptorRPCTest extends AbstractCXFTest {
+    
+    Message message;
+    String ns = "http://apache.org/hello_world_rpclit";
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        BindingFactoryManager bfm = getBus().getExtension(BindingFactoryManager.class);
+        bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", 
+                                   new SoapBindingFactory());
+        message = new MessageImpl();
+        message.put(Message.HTTP_REQUEST_METHOD, "GET");
+        message.put(Message.BASE_PATH, "SoapPort");
+        
+        Exchange exchange = new ExchangeImpl();
+        message.setExchange(exchange);        
+
+
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        URL resource = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
+        assertNotNull(resource);
+        bean.setWsdlURL(resource);
+        bean.setBus(getBus());
+        bean.setServiceClass(RPCLitGreeterImpl.class);
+        RPCLitGreeterImpl greeter = new RPCLitGreeterImpl();
+        BeanInvoker invoker = new BeanInvoker(greeter);
+        bean.setInvoker(invoker);
+
+        Service service = bean.create();
+        
+        EndpointInfo endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPortRPCLit"));
+        Endpoint endpoint = new EndpointImpl(getBus(), service, endpointInfo);
+        exchange.put(Endpoint.class, endpoint);
+    }
+    
+    public void testGetSayHiFromPath() throws Exception {
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/sayHi");       
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        
+        Object parameters = message.getContent(List.class);
+        assertNotNull(parameters);
+        assertEquals(0, ((List)parameters).size());
+        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        assertNotNull(boi);
+        assertEquals(new QName(ns, "sayHi"), boi.getName());
+    }
+    
+    public void testGetGreetMeFromPath() throws Exception {
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe/me/king");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();        
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        
+        Object parameters = message.getContent(List.class);
+        assertNotNull(parameters);
+        assertEquals(1, ((List)parameters).size());
+        String value = (String) ((List)parameters).get(0);
+        assertEquals("king", value);
+    }
+    
+    public void testGetSayHiFromQuery() throws Exception {
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
+        message.put(Message.QUERY_STRING, "?me=king");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        
+        Object parameters = message.getContent(List.class);
+        assertNotNull(parameters);
+        assertEquals(1, ((List)parameters).size());
+        String value = (String) ((List)parameters).get(0);
+        assertEquals("king", value);
+    }
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=469089&r1=469088&r2=469089
==============================================================================
--- 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 30 00:26:47 2006
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.transport.http;
 
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -53,17 +52,13 @@
 import org.mortbay.http.HttpResponse;
 import org.mortbay.http.handler.AbstractHttpHandler;
 
-
 public class JettyHTTPDestination extends AbstractHTTPDestination {
-    
-    public static final String HTTP_REQUEST =
-        JettyHTTPDestination.class.getName() + ".REQUEST";
-    public static final String HTTP_RESPONSE =
-        JettyHTTPDestination.class.getName() + ".RESPONSE";
-    
-    protected static final String ANONYMOUS_ADDRESS =
-        "http://www.w3.org/2005/08/addressing/anonymous";
-    
+
+    public static final String HTTP_REQUEST = JettyHTTPDestination.class.getName() + ".REQUEST";
+    public static final String HTTP_RESPONSE = JettyHTTPDestination.class.getName() + ".RESPONSE";
+
+    protected static final String ANONYMOUS_ADDRESS = "http://www.w3.org/2005/08/addressing/anonymous";
+
     protected ServerEngine engine;
     protected MessageObserver incomingObserver;
 
@@ -75,10 +70,7 @@
      * @param endpointInfo the endpoint info of the destination
      * @throws IOException
      */
-    public JettyHTTPDestination(Bus b,
-                                ConduitInitiator ci,
-                                EndpointInfo endpointInfo)
-        throws IOException {
+    public JettyHTTPDestination(Bus b, ConduitInitiator ci, EndpointInfo endpointInfo) throws IOException {
         this(b, ci, endpointInfo, null);
     }
 
@@ -92,15 +84,11 @@
      * @throws IOException
      */
 
-    public JettyHTTPDestination(Bus b,
-                                ConduitInitiator ci,
-                                EndpointInfo endpointInfo,
-                                ServerEngine eng)
+    public JettyHTTPDestination(Bus b, ConduitInitiator ci, EndpointInfo endpointInfo, ServerEngine eng)
         throws IOException {
         super(b, ci, endpointInfo);
-        engine = eng != null 
-                 ? eng
-                 : JettyHTTPServerEngine.getForPort(bus, nurl.getProtocol(), nurl.getPort());
+        engine = eng != null ? eng : JettyHTTPServerEngine
+            .getForPort(bus, nurl.getProtocol(), nurl.getPort());
     }
 
     /**
@@ -115,36 +103,34 @@
                 URL url = new URL(getAddressValue());
                 if (contextMatchOnStem()) {
                     engine.addServant(url, new AbstractHttpHandler() {
-                            public void handle(String pathInContext, String pathParams,
-                                               HttpRequest req, HttpResponse resp)
-                                throws IOException {
-                                String name = getName();
-                                if (pathInContext.startsWith(name)) {
-                                    doService(req, resp);                    
-                                }
+                        public void handle(String pathInContext, String pathParams, HttpRequest req,
+                                           HttpResponse resp) throws IOException {
+                            String name = getName();
+                            if (pathInContext.startsWith(name)) {
+                                doService(req, resp);
                             }
-                        });
+                        }
+                    });
                 } else {
                     engine.addServant(url, new AbstractHttpHandler() {
-                            public void handle(String pathInContext, String pathParams,
-                                               HttpRequest req, HttpResponse resp)
-                                throws IOException {
-                                if (pathInContext.equals(getName())) {
-                                    doService(req, resp);
-                                }
+                        public void handle(String pathInContext, String pathParams, HttpRequest req,
+                                           HttpResponse resp) throws IOException {
+                            if (pathInContext.startsWith(getName())) {
+                                doService(req, resp, getName());
                             }
-                        });
+                        }
+                    });
                 }
             } catch (Exception e) {
                 LOG.log(Level.WARNING, "URL creation failed: ", e);
             }
         } else {
             LOG.info("unregistering incoming observer: " + incomingObserver);
-            engine.removeServant(nurl);            
+            engine.removeServant(nurl);
         }
         incomingObserver = observer;
     }
-    
+
     /**
      * Retreive a back-channel Conduit, which must be policy-compatible
      * with the current Message and associated Destination. For example
@@ -158,23 +144,18 @@
      * @param address the backchannel address (null to indicate anonymous)
      * @return a suitable Conduit
      */
-    public Conduit getBackChannel(Message inMessage,
-                                  Message partialResponse,
-                                  EndpointReferenceType address)
+    public Conduit getBackChannel(Message inMessage, Message partialResponse, EndpointReferenceType address)
         throws IOException {
         HttpResponse response = (HttpResponse)inMessage.get(HTTP_RESPONSE);
         Conduit backChannel = null;
         Exchange ex = inMessage.getExchange();
-        EndpointReferenceType target = address != null
-                                       ? address
-                                       : ex.get(EndpointReferenceType.class);
+        EndpointReferenceType target = address != null ? address : ex.get(EndpointReferenceType.class);
         if (target == null) {
             backChannel = new BackChannelConduit(response);
         } else {
             if (partialResponse != null) {
                 // setup the outbound message to for 202 Accepted
-                partialResponse.put(Message.RESPONSE_CODE,
-                                    HttpURLConnection.HTTP_ACCEPTED);
+                partialResponse.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_ACCEPTED);
                 backChannel = new BackChannelConduit(response);
                 ex.put(EndpointReferenceType.class, target);
             } else {
@@ -200,17 +181,16 @@
     /**
      * Shutdown the Destination, i.e. stop accepting incoming messages.
      */
-    public void shutdown() {  
+    public void shutdown() {
     }
-        
+
     /**
      * Copy the request headers into the message.
      * 
      * @param message the current message
      * @param headers the current set of headers
      */
-    protected void copyRequestHeaders(Message message,
-                                      Map<String, List<String>> headers) {
+    protected void copyRequestHeaders(Message message, Map<String, List<String>> headers) {
         HttpRequest req = (HttpRequest)message.get(HTTP_REQUEST);
         for (Enumeration e = req.getFieldNames(); e.hasMoreElements();) {
             String fname = (String)e.nextElement();
@@ -225,9 +205,9 @@
                 String val = (String)e2.nextElement();
                 values.add(val);
             }
-        }        
+        }
     }
-    
+
     /**
      * Copy the response headers into the response.
      * 
@@ -246,25 +226,26 @@
             }
         }
     }
-    
-    protected void doService(HttpRequest req, HttpResponse resp)
-        throws IOException {
+
+    protected void doService(HttpRequest req, HttpResponse resp) throws IOException {
+        doService(req, resp, null);
+    }
+
+    protected void doService(HttpRequest req, HttpResponse resp, String pathInContext) throws IOException {
         if (getServer().isSetRedirectURL()) {
             resp.sendRedirect(getServer().getRedirectURL());
             resp.commit();
             req.setHandled(true);
             return;
-        }    
-      
-         
+        }
+
         if ("GET".equals(req.getMethod()) && req.getURI().toString().toLowerCase().endsWith("?wsdl")) {
             try {
-                
-                
+
                 resp.addField("Content-Type", "text/xml");
-                
+
                 OutputStream os = resp.getOutputStream();
-                
+
                 WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
                 Definition def = new ServiceWSDLBuilder(endpointInfo.getService()).build();
                 wsdlWriter.writeWSDL(def, os);
@@ -273,23 +254,26 @@
                 req.setHandled(true);
                 return;
             } catch (Exception ex) {
-                
+
                 ex.printStackTrace();
             }
         }
-        
-        
+
         // REVISIT: service on executor if associated with endpoint
-        serviceRequest(req, resp);
+        serviceRequest(req, resp, pathInContext);
     }
-    
-    protected void serviceRequest(final HttpRequest req, final HttpResponse resp)
+
+    protected void serviceRequest(final HttpRequest req, final HttpResponse resp) throws IOException {
+        serviceRequest(req, resp, null);
+    }
+
+    protected void serviceRequest(final HttpRequest req, final HttpResponse resp, String base)
         throws IOException {
         try {
             if (LOG.isLoggable(Level.INFO)) {
                 LOG.info("Service http request on thread: " + Thread.currentThread());
             }
-            
+
             MessageImpl inMessage = new MessageImpl();
             inMessage.setContent(InputStream.class, req.getInputStream());
             inMessage.put(HTTP_REQUEST, req);
@@ -297,13 +281,15 @@
             inMessage.put(Message.HTTP_REQUEST_METHOD, req.getMethod());
             inMessage.put(Message.PATH_INFO, req.getPath());
             inMessage.put(Message.QUERY_STRING, req.getQuery());
+            inMessage.put(Message.CONTENT_TYPE, req.getContentType());
+            inMessage.put(Message.BASE_PATH, base);
 
             setHeaders(inMessage);
-            
-            inMessage.setDestination(this);            
-            
+
+            inMessage.setDestination(this);
+
             incomingObserver.onMessage(inMessage);
-            
+
             resp.commit();
             req.setHandled(true);
         } finally {
@@ -319,7 +305,7 @@
         OutputStream responseStream = null;
         if (responseObj instanceof HttpResponse) {
             HttpResponse response = (HttpResponse)responseObj;
-                
+
             Integer i = (Integer)outMessage.get(Message.RESPONSE_CODE);
             if (i != null) {
                 int status = i.intValue();
@@ -333,10 +319,10 @@
             } else {
                 response.setStatus(HttpURLConnection.HTTP_OK);
             }
-            
+
             copyResponseHeaders(outMessage, response);
             responseStream = response.getOutputStream();
-                    
+
             if (isOneWay(outMessage)) {
                 response.commit();
             }
@@ -344,28 +330,28 @@
             LOG.log(Level.WARNING, "UNEXPECTED_RESPONSE_TYPE_MSG", responseObj.getClass());
             throw new IOException("UNEXPECTED_RESPONSE_TYPE_MSG" + responseObj.getClass());
         }
-    
+
         if (isOneWay(outMessage)) {
             outMessage.remove(HTTP_RESPONSE);
         }
         return responseStream;
     }
-    
+
     /**
      * Backchannel conduit.
      */
     protected class BackChannelConduit implements Conduit {
-        
+
         protected HttpResponse response;
         protected EndpointReferenceType target;
-        
+
         BackChannelConduit(HttpResponse resp) {
             response = resp;
-            target =
-                EndpointReferenceUtils.getEndpointReference(ANONYMOUS_ADDRESS);
+            target = EndpointReferenceUtils.getEndpointReference(ANONYMOUS_ADDRESS);
         }
+
         public void close(Message msg) throws IOException {
-            msg.getContent(OutputStream.class).close();        
+            msg.getContent(OutputStream.class).close();
         }
 
         /**
@@ -383,19 +369,19 @@
          * 
          * @param message the message to be sent.
          */
+        @SuppressWarnings("unchecked")
         public void send(Message message) throws IOException {
             message.put(HTTP_RESPONSE, response);
-            message.setContent(OutputStream.class,
-                               new WrappedOutputStream(message, response));
+            message.setContent(OutputStream.class, new WrappedOutputStream(message, response));
         }
-        
+
         /**
          * @return the reference associated with the target Destination
-         */    
+         */
         public EndpointReferenceType getTarget() {
             return target;
         }
-        
+
         /**
          * Retreive the back-channel Destination.
          * 
@@ -405,22 +391,22 @@
         public Destination getBackChannel() {
             return null;
         }
-        
+
         /**
          * Close the conduit
          */
         public void close() {
         }
     }
-    
+
     /**
      * Wrapper stream responsible for flushing headers and committing outgoing
      * HTTP-level response.
      */
     private class WrappedOutputStream extends AbstractWrappedOutputStream {
-        
+
         protected HttpResponse response;
-        
+
         WrappedOutputStream(Message m, HttpResponse resp) {
             super(m);
             response = resp;
@@ -444,9 +430,9 @@
             commitResponse();
         }
 
-        protected void onWrite() throws IOException {            
+        protected void onWrite() throws IOException {
         }
-        
+
         private void commitResponse() {
             try {
                 response.commit();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java Mon Oct 30 00:26:47 2006
@@ -56,4 +56,4 @@
             System.out.println("done!");
         }
     }
-}
\ No newline at end of file
+}

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/common/ClientServerTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/common/ClientServerTestBase.java?view=diff&rev=469089&r1=469088&r2=469089
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/common/ClientServerTestBase.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/common/ClientServerTestBase.java Mon Oct 30 00:26:47 2006
@@ -19,6 +19,10 @@
 
 package org.apache.cxf.systest.common;
 
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -39,6 +43,15 @@
 
     protected ClientServerTestBase(String name) {
         super(name);
+    }
+    
+    protected HttpURLConnection getHttpConnection(String target) throws Exception {
+        URL url = new URL(target);        
+        
+        URLConnection connection = url.openConnection();            
+        
+        assertTrue(connection instanceof HttpURLConnection);
+        return (HttpURLConnection)connection;        
     }
 
     protected boolean runClient(Runnable clientImpl, long timeOut, TimeUnit timeUnit)



Mime
View raw message