You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kamlesh <KS...@scrippsnetworks.com> on 2007/12/27 21:43:43 UTC
unable to get uri parameter in rest service having wrapped true
Hi, All
I have following simple service. In wrapped false mode I get correct
response:
url:
http://localhost:8080/mywebapp-web-1.0-SNAPSHOT/services/NamasteServiceRest/namaste/Kamlesh
<ns2:namasteResponse
xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">Namaste
Kamlesh</ns2:namasteResponse>
But if I change configuration to wrapped true, I get following response
<ns2:namasteResponse
xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">
<response> Namaste null</response>
</ns2:namasteResponse>
Kindly help me to understand why.
<jaxws:endpoint id="namaste_rest"
implementor="com.scrippsnetworks.transcode.webservices.impl.NamasteServiceImpl"
address="/NamasteServiceRest"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<bean
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="wrapped" value="false" />
</bean>
</jaxws:serviceFactory>
</jaxws:endpoint>
Interface:
========
@WebService
public interface NamasteService {
@Get
@HttpResource(location = "/namaste/{text}")
String namaste(NamasteText text);
}
impl class
========
public class NamasteServiceImpl implements NamasteService {
/* (non-Javadoc)
* @see
com.scrippsnetworks.transcode.webservices.NamasteService#namaste(java.lang.String)
*/
public String namaste(NamasteText text) {
//
return "Namaste " + text.getText();
}
}
public class NamasteText {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
--
View this message in context: http://www.nabble.com/unable-to-get-uri-parameter-in-rest-service-having-wrapped-true-tp14518283p14518283.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: unable to get uri parameter in rest service having wrapped true
Posted by Kamlesh <KS...@scrippsnetworks.com>.
Benson
I am using CXF version 2.0.3.
Regards
Kamlesh
Benson Margulies-4 wrote:
>
> It sure looks like a bug. What version of CXF are you using?
>
> On Dec 27, 2007 3:43 PM, Kamlesh <KS...@scrippsnetworks.com> wrote:
>
>>
>> Hi, All
>>
>> I have following simple service. In wrapped false mode I get correct
>> response:
>>
>> url:
>>
>> http://localhost:8080/mywebapp-web-1.0-SNAPSHOT/services/NamasteServiceRest/namaste/Kamlesh
>>
>> <ns2:namasteResponse
>> xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">Namaste
>> Kamlesh</ns2:namasteResponse>
>>
>> But if I change configuration to wrapped true, I get following response
>>
>> <ns2:namasteResponse
>> xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">
>> <response> Namaste null</response>
>> </ns2:namasteResponse>
>>
>> Kindly help me to understand why.
>>
>>
>> <jaxws:endpoint id="namaste_rest"
>>
>> implementor="
>> com.scrippsnetworks.transcode.webservices.impl.NamasteServiceImpl"
>> address="/NamasteServiceRest"
>> bindingUri="http://apache.org/cxf/binding/http">
>> <jaxws:serviceFactory>
>> <bean
>> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>> <property name="wrapped" value="false" />
>> </bean>
>> </jaxws:serviceFactory>
>> </jaxws:endpoint>
>>
>> Interface:
>> ========
>> @WebService
>> public interface NamasteService {
>> @Get
>> @HttpResource(location = "/namaste/{text}")
>> String namaste(NamasteText text);
>>
>> }
>>
>> impl class
>> ========
>>
>> public class NamasteServiceImpl implements NamasteService {
>>
>> /* (non-Javadoc)
>> * @see
>> com.scrippsnetworks.transcode.webservices.NamasteService#namaste(
>> java.lang.String)
>> */
>>
>> public String namaste(NamasteText text) {
>> //
>> return "Namaste " + text.getText();
>> }
>>
>>
>>
>> }
>>
>> public class NamasteText {
>> private String text;
>>
>> public String getText() {
>> return text;
>> }
>>
>> public void setText(String text) {
>> this.text = text;
>> }
>> }
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/unable-to-get-uri-parameter-in-rest-service-having-wrapped-true-tp14518283p14518283.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/unable-to-get-uri-parameter-in-rest-service-having-wrapped-true-tp14518283p14527772.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: unable to get uri parameter in rest service having wrapped true
Posted by Benson Margulies <bi...@gmail.com>.
It sure looks like a bug. What version of CXF are you using?
On Dec 27, 2007 3:43 PM, Kamlesh <KS...@scrippsnetworks.com> wrote:
>
> Hi, All
>
> I have following simple service. In wrapped false mode I get correct
> response:
>
> url:
>
> http://localhost:8080/mywebapp-web-1.0-SNAPSHOT/services/NamasteServiceRest/namaste/Kamlesh
>
> <ns2:namasteResponse
> xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">Namaste
> Kamlesh</ns2:namasteResponse>
>
> But if I change configuration to wrapped true, I get following response
>
> <ns2:namasteResponse
> xmlns:ns2="http://webservices.transcode.scrippsnetworks.com/">
> <response> Namaste null</response>
> </ns2:namasteResponse>
>
> Kindly help me to understand why.
>
>
> <jaxws:endpoint id="namaste_rest"
>
> implementor="
> com.scrippsnetworks.transcode.webservices.impl.NamasteServiceImpl"
> address="/NamasteServiceRest"
> bindingUri="http://apache.org/cxf/binding/http">
> <jaxws:serviceFactory>
> <bean
> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
> <property name="wrapped" value="false" />
> </bean>
> </jaxws:serviceFactory>
> </jaxws:endpoint>
>
> Interface:
> ========
> @WebService
> public interface NamasteService {
> @Get
> @HttpResource(location = "/namaste/{text}")
> String namaste(NamasteText text);
>
> }
>
> impl class
> ========
>
> public class NamasteServiceImpl implements NamasteService {
>
> /* (non-Javadoc)
> * @see
> com.scrippsnetworks.transcode.webservices.NamasteService#namaste(
> java.lang.String)
> */
>
> public String namaste(NamasteText text) {
> //
> return "Namaste " + text.getText();
> }
>
>
>
> }
>
> public class NamasteText {
> private String text;
>
> public String getText() {
> return text;
> }
>
> public void setText(String text) {
> this.text = text;
> }
> }
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/unable-to-get-uri-parameter-in-rest-service-having-wrapped-true-tp14518283p14518283.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>