You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by mm...@apache.org on 2006/11/03 09:47:10 UTC

svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Author: mmao
Date: Fri Nov  3 00:47:09 2006
New Revision: 470723

URL: http://svn.apache.org/viewvc?view=rev&rev=470723
Log:
HTTP GET Update 

* added fixedparameterorder configuration, and set the default value to false, 
   this means that the given parameters in the request uri can be random, but the name of value must be given correctly according to the style/use of the service.
   In the JAX-WS case, the name is the value of the name attribute in WebParam defined in JSR181.
* change the default value of contextMatchStrategy to stem since this kind of uri more and more popular.
* enable the -Xdv option to generate the default value for http destination.

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.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/transports/http/pom.xml
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-destination.xsd

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=470723&r1=470722&r2=470723
==============================================================================
--- 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 Fri Nov  3 00:47:09 2006
@@ -49,6 +49,7 @@
     String SCHEMA_VALIDATION_ENABLED = Message.class.getCanonicalName() + ".schemaValidationEnabled";
     String CONTENT_TYPE = Message.class.getName() + ".ContentType";
     String BASE_PATH = Message.class.getName() + ".BASE_PATH";
+    String FIXED_PARAMETER_ORDER = Message.class.getName() + "FIXED_PARAMETER_ORDER";
 
     String getId();
     void setId(String id);

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=470723&r1=470722&r2=470723
==============================================================================
--- 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 Fri Nov  3 00:47:09 2006
@@ -56,18 +56,15 @@
 
     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);
+        LOG.info("Invoking HTTP method " + method);        
         if (!isGET(message)) {
             LOG.info("URIMappingInterceptor can only handle HTTP GET, not HTTP " + method);
             return;
         }
-        if (op != null) {
-            return;
-        }
+
         String opName = getOperationName(message);
         LOG.info("URIMappingInterceptor get operation: " + opName);
-        op = ServiceModelUtil.getOperation(message.getExchange(), opName);
+        BindingOperationInfo op = ServiceModelUtil.getOperation(message.getExchange(), opName);
         
         if (op == null || opName == null || op.getName() == null
             || StringUtils.isEmpty(op.getName().getLocalPart())
@@ -84,9 +81,9 @@
         return md.getMethod(operation);
     }
        
-    private boolean requireCheckParameterName(Message message) {
-        // TODO add a configuration, if return false, then the parameter should be given by order.
-        Boolean order = (Boolean) message.get("HTTP_GET_CHECK_PARAM_NAME");
+    private boolean isFixedParameterOrder(Message message) {
+        // Default value is false
+        Boolean order = (Boolean)message.get(Message.FIXED_PARAMETER_ORDER);        
         return order != null && order;
     }
     
@@ -129,13 +126,14 @@
 
         Map<String, String> queries = getQueries(message);
         
-        if (requireCheckParameterName(message)) {
-            boolean emptyQueries = CollectionUtils.isEmpty(queries.keySet());
+        if (!isFixedParameterOrder(message)) {
+            boolean emptyQueries = CollectionUtils.isEmpty(queries.values());            
+            
             List<String> names = ServiceModelUtil.getOperationInputPartNames(operation.getOperationInfo());
             queries = keepInOrder(queries, 
                                   operation.getOperationInfo(),
                                   names);
-            if (!emptyQueries && CollectionUtils.isEmpty(queries.keySet())) {
+            if (!emptyQueries && CollectionUtils.isEmpty(queries.values())) {            
                 throw new Fault(new org.apache.cxf.common.i18n.Message("ORDERED_PARAM_REQUIRED", 
                                                                        BUNDLE, 
                                                                        names.toString()));

Modified: 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=diff&rev=470723&r1=470722&r2=470723
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java Fri Nov  3 00:47:09 2006
@@ -29,6 +29,7 @@
 import org.apache.cxf.calculator.CalculatorImpl;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.message.Exchange;
@@ -79,49 +80,30 @@
     }
     
     public void testGetAddFromPath() throws Exception {
-        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add/arg0/1/arg1/2");
+        message.put(Message.FIXED_PARAMETER_ORDER, Boolean.TRUE);
+        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add/arg0/1/arg1/0");
         
         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());
-         
-        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());
+        assertion();        
     }
     
     public void testGetAddFromQuery() throws Exception {
+        message.put(Message.FIXED_PARAMETER_ORDER, Boolean.TRUE);
         message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add");
-        message.put(Message.QUERY_STRING, "arg0=1&arg1=2");
+        message.put(Message.QUERY_STRING, "arg0=1&arg1=0");
         
         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());
-                 
-        Integer value = (Integer) ((List)parameters).get(0);
-        assertEquals(1, value.intValue());
-        value = (Integer) ((List)parameters).get(1);
-        assertEquals(2, value.intValue());
+        assertion();
     }
     
     public void testGetAddFromQueryOrdered() throws Exception {
-        message.put("HTTP_GET_CHECK_PARAM_NAME", Boolean.TRUE);
         message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add");
         message.put(Message.QUERY_STRING, "arg1=0&arg0=1");
         
@@ -129,8 +111,38 @@
         interceptor.handleMessage(message);
         
         assertNull(message.getContent(Exception.class));
+        assertion();
+    }
+    
+    public void testGetAddFromPathOrdered() throws Exception {
+        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add/arg1/0/arg0/1");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));
+        assertion();
+    }    
+    
+    public void testGetAddFromQueryOrderedFault() throws Exception {        
+        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add");
+        message.put(Message.QUERY_STRING, "one=1&two=2");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        try {
+            interceptor.handleMessage(message);
+        } catch (Exception e) {
+            assertTrue(e instanceof Fault);
+            assertEquals("Parameter should be ordered in the following sequence: [arg0, arg1]", 
+                         e.getMessage());
+        }
         
         Object parameters = message.getContent(List.class);
+        assertNull(parameters);
+    }    
+    
+    private void assertion() throws Exception {
+        Object parameters = message.getContent(List.class);
         assertNotNull(parameters);
         assertEquals(2, ((List)parameters).size());
                  
@@ -138,21 +150,8 @@
         assertEquals(1, value.intValue());
         value = (Integer) ((List)parameters).get(1);
         assertEquals(0, value.intValue());
-    }
-    
-    public void testGetAddFromQueryOrderedNull() throws Exception {
-        message.put("HTTP_GET_CHECK_PARAM_NAME", Boolean.TRUE);
-        message.put(Message.PATH_INFO, "/CalculatorService/SoapPort/add");
-        message.put(Message.QUERY_STRING, "one=1&two=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());        
-        
-        assertNull(((List)parameters).get(0));
-        assertNull(((List)parameters).get(1));        
+        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        assertNotNull(boi);
+        assertEquals(new QName(ns, "add"), boi.getName());
     }    
 }

Modified: 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=diff&rev=470723&r1=470722&r2=470723
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java Fri Nov  3 00:47:09 2006
@@ -28,6 +28,7 @@
 import org.apache.cxf.binding.soap.SoapBindingFactory;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.message.Exchange;
@@ -94,7 +95,7 @@
     }
     
     public void testGetGreetMeFromPath() throws Exception {
-        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe/me/king+author");
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe/in/king+author");
         
         URIMappingInterceptor interceptor = new URIMappingInterceptor();        
         interceptor.handleMessage(message);
@@ -108,25 +109,56 @@
         assertEquals("king author", value);
     }
     
-    public void testGetSayHiFromQuery() throws Exception {
+    public void testGetSayHiFromQueryFixedOrder() throws Exception {
+        message.put(Message.FIXED_PARAMETER_ORDER, Boolean.TRUE);
         message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
-        message.put(Message.QUERY_STRING, "?me=king");
+        message.put(Message.QUERY_STRING, "me=king");
         
         URIMappingInterceptor interceptor = new URIMappingInterceptor();
         interceptor.handleMessage(message);
         
         assertNull(message.getContent(Exception.class));
         
+        assertion();
+    }
+    
+    public void testGetSayHiFromQueryRandomOrder() throws Exception {
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
+        message.put(Message.QUERY_STRING, "in=king");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        interceptor.handleMessage(message);
+        
+        assertNull(message.getContent(Exception.class));        
+        assertion();
+    }
+    
+    public void testGetSayHiFromQueryRandomOrderFault() throws Exception {
+        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
+        message.put(Message.QUERY_STRING, "me=king");
+        
+        URIMappingInterceptor interceptor = new URIMappingInterceptor();
+        try {
+            interceptor.handleMessage(message);
+        } catch (Exception e) {
+            assertTrue(e instanceof Fault);
+            assertEquals("Parameter should be ordered in the following sequence: [in]", e.getMessage());
+        }
+        Object parameters = message.getContent(List.class);
+        assertNull(parameters);
+    }
+    
+    private void assertion() throws Exception {
         Object parameters = message.getContent(List.class);
         assertNotNull(parameters);
         assertEquals(1, ((List)parameters).size());
         String value = (String) ((List)parameters).get(0);
-        assertEquals("king", value);
+        assertEquals("king", value);        
     }
     
     public void testGetSayHiFromQueryEncoded() throws Exception {
         message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
-        message.put(Message.QUERY_STRING, "?me=king+author");
+        message.put(Message.QUERY_STRING, "in=king+author");
         
         URIMappingInterceptor interceptor = new URIMappingInterceptor();
         interceptor.handleMessage(message);

Modified: incubator/cxf/trunk/rt/transports/http/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/pom.xml?view=diff&rev=470723&r1=470722&r2=470723
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/pom.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/pom.xml Fri Nov  3 00:47:09 2006
@@ -116,7 +116,8 @@
                                     <bindingFile>${basedir}/src/main/resources/schemas/wsdl/http-conf.xjb</bindingFile>
                                     <extension>true</extension>
                                     <extensionArgs>
-                                        <extensionArg>-Xcfg</extensionArg>
+                                        <extensionArg>-Xdv</extensionArg>
+                                        <extensionArg>-Xcfg</extensionArg>                                    
                                     </extensionArgs>
                                     <deleteDirs>
                                         <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?view=diff&rev=470723&r1=470722&r2=470723
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Fri Nov  3 00:47:09 2006
@@ -214,8 +214,7 @@
     */
     }
 
-    boolean contextMatchOnStem() {
-        return "stem".equals(getContextMatchStrategy());
-    }
-    
+    boolean contextMatchOnExact() {
+        return "exact".equals(getContextMatchStrategy());
+    }    
 }

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=470723&r1=470722&r2=470723
==============================================================================
--- 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 Fri Nov  3 00:47:09 2006
@@ -102,12 +102,11 @@
             LOG.info("registering incoming observer: " + observer);
             try {
                 URL url = new URL(getAddressValue());
-                if (contextMatchOnStem()) {
+                if (contextMatchOnExact()) {
                     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)) {
+                            if (pathInContext.equals(getName())) {
                                 doService(req, resp);
                             }
                         }
@@ -278,7 +277,8 @@
             if (!StringUtils.isEmpty(getAddressValue())) {
                 inMessage.put(Message.BASE_PATH, new URL(getAddressValue()).getPath());
             }
-
+            inMessage.put(Message.FIXED_PARAMETER_ORDER, isFixedParameterOrder());
+            
             setHeaders(inMessage);
 
             inMessage.setDestination(this);

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-destination.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-destination.xsd?view=diff&rev=470723&r1=470722&r2=470723
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-destination.xsd (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-destination.xsd Fri Nov  3 00:47:09 2006
@@ -36,7 +36,8 @@
     <xs:element name="server" type="http-conf:HTTPServerPolicy"/>
     <xs:element name="authorization" type="sec:AuthorizationPolicy"/>
     <xs:element name="sslServer" type="sec:SSLServerPolicy"/>
-    <xs:element name="contextMatchStrategy" type="xs:string" default="exact"/>
+    <xs:element name="contextMatchStrategy" type="xs:string" default="stem"/>
+    <xs:element name="fixedParameterOrder" type="xs:boolean" default="false"/>
 
     <xs:complexType name="HTTPDestinationConfigBean">        
         <xs:annotation>
@@ -49,6 +50,7 @@
             <xs:element ref="tns:authorization" minOccurs="0"/>
             <xs:element ref="tns:sslServer" minOccurs="0"/>
             <xs:element ref="tns:contextMatchStrategy" minOccurs="0"/>
+            <xs:element ref="tns:fixedParameterOrder" minOccurs="0"/>
         </xs:sequence>
     </xs:complexType>
 



Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by James Mao <ja...@iona.com>.
Hi Dan,

My question basically is when the server start up, how can we let the 
URIMappingInterceptor know which value user provided for 
FIXED_PARAMETER_ORDER if we don't provide a configuration?

This value is a user configuration, if FIXED_PARAMETER_ORDER set to 
true, means user want have fixed parameter order, in this case the 
parameter name is just a placeholder, we will not check the parameter 
name, and the parameter values are given in order.
If user doesn't set the value or set to false(DEFAULT value), that means 
that the order of parameters given can be random, and we will check the 
parameter names, the name is the value of the name attribute in WebParam 
defined in JSR181.
So, by default, the following two uris are same:

http://localhost/SoapContext/SoapPort/greetUs?you=Dan&me=James
http://localhost/SoapContext/SoapPort/greetUs?me=James&you=Dan
or
http://localhost/SoapContext/SoapPort/greetUs/me/James/you/Dan
http://localhost/SoapContext/SoapPort/greetUs/you/Dan/me/James

So, what i mean is that we provide a configuration for user to decide 
which server mode they want to use.
I can remove the configuration if user feel that this configuration is 
unnecessary,  the  server should always work on  the random  parameter 
order, and should always check the parameter name.

According to this, i have not figure out where to place this 
configuration instead of the JettyHTTPDestination, maybe you already 
have a good idea.
I guess we can talk this tomorrow morning, right?

Cheers,
James.

Dan Diephouse 写道:
> Does it need to be set at all by default? That is, can you have the 
> URIMappingInterceptor act how you want it to by default when there is 
> a null value? And then just allow overriding by setting the value on 
> the message?
> - Dan
>
> James Mao wrote:
>
>> Hi Dan,
>>
>> Thanks for pointing this.
>> I agreed with you that we need to find a place to configure this 
>> value gracefully.
>> Do you have any suggestions?
>>
>> Thanks,
>> James.
>>
>>> mmao@apache.org wrote:
>>>
>>>> HTTP GET Update
>>>> * added fixedparameterorder configuration, and set the default 
>>>> value to false,   this means that the given parameters in the 
>>>> request uri can be random, but the name of value must be given 
>>>> correctly according to the style/use of the service.
>>>>   In the JAX-WS case, the name is the value of the name attribute 
>>>> in WebParam defined in JSR181.
>>>>
>>>>  
>>>>
>>> Hi James,
>>>
>>> Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER 
>>> should be part of the message or the JettyHTTPDestination. If we 
>>> need this parameter, it should probably go on the 
>>> URIMappingInterceptor as that is the only place really reading it. 
>>> Second, with the code in JettyHTTPDestination it will only work with 
>>> just the Jetty HTTP transport, not the servlet or possibly the 
>>> future asyncweb transport. It would seem to me that it would be 
>>> better if there was no fixed_parameter_order value set, you assumed 
>>> whatever you want the default to be - instead of trying to 
>>> explicitly set the default.
>>>
>>> Regards,
>>>
>>> - Dan
>>>
>>
>
>


Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by James Mao <ja...@iona.com>.
Hi Dan,

My question basically is when the server start up, how can we let the 
URIMappingInterceptor know which value user provided for 
FIXED_PARAMETER_ORDER if we don't provide a configuration?

This value is a user configuration, if FIXED_PARAMETER_ORDER set to 
true, means user want have fixed parameter order, in this case the 
parameter name is just a placeholder, we will not check the parameter 
name, and the parameter values are given in order.
If user doesn't set the value or set to false(DEFAULT value), that means 
that the order of parameters given can be random, and we will check the 
parameter names, the name is the value of the name attribute in WebParam 
defined in JSR181.
So, by default, the following two uris are same:

http://localhost/SoapContext/SoapPort/greetUs?you=Dan&me=James
http://localhost/SoapContext/SoapPort/greetUs?me=James&you=Dan
or
http://localhost/SoapContext/SoapPort/greetUs/me/James/you/Dan
http://localhost/SoapContext/SoapPort/greetUs/you/Dan/me/James

So, what i mean is that we provide a configuration for user to decide 
which server mode they want to use.
I can remove the configuration if user feel that this configuration is 
unnecessary,  the  server should always work on  the random  parameter 
order, and should always check the parameter name.

According to this, i have not figure out where to place this 
configuration instead of the JettyHTTPDestination, maybe you already 
have a good idea.
I guess we can talk this tomorrow morning, right?

Cheers,
James.

Dan Diephouse 写道:
> Does it need to be set at all by default? That is, can you have the 
> URIMappingInterceptor act how you want it to by default when there is 
> a null value? And then just allow overriding by setting the value on 
> the message?
> - Dan
>
> James Mao wrote:
>
>> Hi Dan,
>>
>> Thanks for pointing this.
>> I agreed with you that we need to find a place to configure this 
>> value gracefully.
>> Do you have any suggestions?
>>
>> Thanks,
>> James.
>>
>>> mmao@apache.org wrote:
>>>
>>>> HTTP GET Update
>>>> * added fixedparameterorder configuration, and set the default 
>>>> value to false,   this means that the given parameters in the 
>>>> request uri can be random, but the name of value must be given 
>>>> correctly according to the style/use of the service.
>>>>   In the JAX-WS case, the name is the value of the name attribute 
>>>> in WebParam defined in JSR181.
>>>>
>>>>  
>>>>
>>> Hi James,
>>>
>>> Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER 
>>> should be part of the message or the JettyHTTPDestination. If we 
>>> need this parameter, it should probably go on the 
>>> URIMappingInterceptor as that is the only place really reading it. 
>>> Second, with the code in JettyHTTPDestination it will only work with 
>>> just the Jetty HTTP transport, not the servlet or possibly the 
>>> future asyncweb transport. It would seem to me that it would be 
>>> better if there was no fixed_parameter_order value set, you assumed 
>>> whatever you want the default to be - instead of trying to 
>>> explicitly set the default.
>>>
>>> Regards,
>>>
>>> - Dan
>>>
>>
>
>


Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by Dan Diephouse <da...@envoisolutions.com>.
Does it need to be set at all by default? That is, can you have the 
URIMappingInterceptor act how you want it to by default when there is a 
null value? And then just allow overriding by setting the value on the 
message?
- Dan

James Mao wrote:

> Hi Dan,
>
> Thanks for pointing this.
> I agreed with you that we need to find a place to configure this value 
> gracefully.
> Do you have any suggestions?
>
> Thanks,
> James.
>
>> mmao@apache.org wrote:
>>
>>> HTTP GET Update
>>> * added fixedparameterorder configuration, and set the default value 
>>> to false,   this means that the given parameters in the request uri 
>>> can be random, but the name of value must be given correctly 
>>> according to the style/use of the service.
>>>   In the JAX-WS case, the name is the value of the name attribute in 
>>> WebParam defined in JSR181.
>>>
>>>  
>>>
>> Hi James,
>>
>> Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER should 
>> be part of the message or the JettyHTTPDestination. If we need this 
>> parameter, it should probably go on the URIMappingInterceptor as that 
>> is the only place really reading it. Second, with the code in 
>> JettyHTTPDestination it will only work with just the Jetty HTTP 
>> transport, not the servlet or possibly the future asyncweb transport. 
>> It would seem to me that it would be better if there was no 
>> fixed_parameter_order value set, you assumed whatever you want the 
>> default to be - instead of trying to explicitly set the default.
>>
>> Regards,
>>
>> - Dan
>>
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by James Mao <ja...@iona.com>.
Hi Dan,

Thanks for pointing this.
I agreed with you that we need to find a place to configure this value 
gracefully.
Do you have any suggestions?

Thanks,
James.
> mmao@apache.org wrote:
>
>> HTTP GET Update
>> * added fixedparameterorder configuration, and set the default value 
>> to false,   this means that the given parameters in the request uri 
>> can be random, but the name of value must be given correctly 
>> according to the style/use of the service.
>>   In the JAX-WS case, the name is the value of the name attribute in 
>> WebParam defined in JSR181.
>>
>>  
>>
> Hi James,
>
> Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER should 
> be part of the message or the JettyHTTPDestination. If we need this 
> parameter, it should probably go on the URIMappingInterceptor as that 
> is the only place really reading it. Second, with the code in 
> JettyHTTPDestination it will only work with just the Jetty HTTP 
> transport, not the servlet or possibly the future asyncweb transport. 
> It would seem to me that it would be better if there was no 
> fixed_parameter_order value set, you assumed whatever you want the 
> default to be - instead of trying to explicitly set the default.
>
> Regards,
>
> - Dan
>


Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by James Mao <ja...@iona.com>.
Hi Dan,

Thanks for pointing this.
I agreed with you that we need to find a place to configure this value 
gracefully.
Do you have any suggestions?

Thanks,
James.
> mmao@apache.org wrote:
>
>> HTTP GET Update
>> * added fixedparameterorder configuration, and set the default value 
>> to false,   this means that the given parameters in the request uri 
>> can be random, but the name of value must be given correctly 
>> according to the style/use of the service.
>>   In the JAX-WS case, the name is the value of the name attribute in 
>> WebParam defined in JSR181.
>>
>>  
>>
> Hi James,
>
> Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER should 
> be part of the message or the JettyHTTPDestination. If we need this 
> parameter, it should probably go on the URIMappingInterceptor as that 
> is the only place really reading it. Second, with the code in 
> JettyHTTPDestination it will only work with just the Jetty HTTP 
> transport, not the servlet or possibly the future asyncweb transport. 
> It would seem to me that it would be better if there was no 
> fixed_parameter_order value set, you assumed whatever you want the 
> default to be - instead of trying to explicitly set the default.
>
> Regards,
>
> - Dan
>


Re: svn commit: r470723 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/transports/http/ rt/transports/http/src/main/java/org/ap...

Posted by Dan Diephouse <da...@envoisolutions.com>.
mmao@apache.org wrote:

>HTTP GET Update 
>
>* added fixedparameterorder configuration, and set the default value to false, 
>   this means that the given parameters in the request uri can be random, but the name of value must be given correctly according to the style/use of the service.
>   In the JAX-WS case, the name is the value of the name attribute in WebParam defined in JSR181.
>
>  
>
Hi James,

Just looking at this - I'm not sure that FIXED_PARAMETER_ORDER should be 
part of the message or the JettyHTTPDestination. If we need this 
parameter, it should probably go on the URIMappingInterceptor as that is 
the only place really reading it. Second, with the code in 
JettyHTTPDestination it will only work with just the Jetty HTTP 
transport, not the servlet or possibly the future asyncweb transport. It 
would seem to me that it would be better if there was no 
fixed_parameter_order value set, you assumed whatever you want the 
default to be - instead of trying to explicitly set the default.

Regards,

- Dan

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com