First parameter not retrieved if location is just a slash
---------------------------------------------------------

                 Key: CXF-1744
                 URL: https://issues.apache.org/jira/browse/CXF-1744
             Project: CXF
          Issue Type: Bug
          Components: REST
    Affects Versions: 2.1.1
         Environment: Windows Vista, service pack 1
Tomcat 6.0.13
IE 6
jdk1.6.0_01

            Reporter: Gabo Manuel
             Fix For: 2.1.1


Hi All,

I modified the restful sample as follows:

added the following method in the interface:

    @Get
    @HttpResource(location="/{first}/{last}") 
    Customer findCustomer(@WebParam(name="first") String firstName, 
@WebParam(name="last") String lastName) throws CustomerNotFoundFault;

made the following implementation:

        @Override
        public Customer findCustomer(String firstName, String lastName)
                        throws CustomerNotFoundFault {
                
                System.out.println("firstname="+firstName);
                System.out.println("lastname="+lastName);
                return createCustomer();
        }

the web.xml is pretty much the same as in 
http://cwiki.apache.org/CXF20DOC/http-binding.html, except for the following:

        <servlet-mapping>
                <servlet-name>CXFServlet</servlet-name>
                <url-pattern>/services/*</url-pattern>
        </servlet-mapping>

the content of the beans.xml is again almost the same as the site mentioned 
except for the id and address as seen below:

    <jaxws:endpoint 
        id="demo" 
        address="/customers" 
        bindingUri="http://apache.org/cxf/binding/http";
        implementor="demo.restful.server.CustomerServiceImpl"
        >
      <jaxws:serviceFactory>
        <bean class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
           <property name="wrapped" value="true" />
        </bean>
      </jaxws:serviceFactory>
    </jaxws:endpoint>

lib contents are what is included in the distribution. 

Accessed it via IE6 using the following URL:

http://localhost:8080/cxf/services/customers/123/4321

Print out is the following:

Aug 13, 2008 6:45:49 AM 
org.apache.cxf.binding.http.interceptor.DispatchInterceptor handleMessage INFO: 
Invoking GET on /123/4321
Aug 13, 2008 6:45:49 AM 
org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor handleMessage 
INFO: URIParameterInterceptor handle message on path [/123/4321] with 
content-type [null]
firstname=
lastname=4321

The weird thing is if I change the annotation to:
@HttpResource(location="/customers/{first}/{last}") 

and the URL to:
http://localhost:8080/cxf/services/customers/customers/123/4321

The parameters are properly retrieved.

----
Gabo Manuel

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to