Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
These links are quite useful.. Thanks a lot :)

From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] On 
Behalf Of Daghan ACAY
Sent: 24 August 2016 17:27
To: OSGi Developer Mail List 
Subject: Re: [osgi-dev] Help


** This mail has been sent from an external source **

Monaj,



Run curl with debug, this might help 
http://stackoverflow.com/questions/866946/how-can-i-see-the-request-headers-made-by-curl-when-sending-a-request-to-the-ser



Or use a more user friendly rest client such as Postman 
(https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en).
 You can also start Enroute appliation in debug mode and see of the call is 
routed to your post method.

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
Ooops..my bad.. I got the quotes wrong...  (new to Json ☺)  Its working now.. ☺ 
Thanks all ☺

From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] On 
Behalf Of Peter Kriens
Sent: 24 August 2016 22:16
To: OSGi Developer Mail List 
Subject: Re: [osgi-dev] Help


** This mail has been sent from an external source **
Can you share a workspace where it does not work? It does work when I just 
tried it.

Kind regards,

Peter Kriens

On 24 aug. 2016, at 13:44, 
manoj.vrajam...@wipro.com wrote:

Please help me out..I am stuck at this…  ☹

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 15:37
To: OSGi Developer Mail List 
>
Subject: RE: [osgi-dev] Help

Why is POST not returning the Uppercase String? What am I missing here?

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 12:33
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help


public String getUpper(String string) {
return string.toUpperCase();
}

public String postUpper(String string) {
return string.toUpperCase();
}

//GET works..See below

manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello
"HELLO"manoj@manoj-Latitude-E5420:~$

//POST fails...See below ( no error seen)

manoj@manoj-Latitude-E5420:~$ curl -X POST -H 

 "Content-Type:application/json" -d "'Hello'" http://localhost:8080/rest/upper
manoj@manoj-Latitude-E5420:~$


From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 10:44:27
To: OSGi Developer Mail List
Subject: RE: [osgi-dev] Help

postValue() did not work either !!

From: osgi-dev-boun...@mail.osgi.org 
[mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help

** This mail has been sent from an external source **
You are doing a POST but you declared a PUT.

Kind regards,

Peter Kriens

On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:

I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:
manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://




From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help

** This mail has been sent from an external source **

Hi Manoj,

It is similar to get. The java method name starts with the http method name, so 
for instance putUpper() etc.

The test cases in this project should help:

  
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test


Cheers,
=David



On Aug 23, 2016, at 8:36 PM, 
> 
> wrote:

Hi All,

The Enroute Quick Start Tutorial sample application helps to invoke the “GET” 
HTTP method by adding methods preceding with “get” like getUpper(), getStatus() 
and so on. to the Application class.

I am trying to test using curl on a Linux terminal. GET works fine.

Now,

I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST API 
application.

What should I do?  Please suggest…

Thanks,
Manoj
The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please 

Re: [osgi-dev] Help

2016-08-24 Thread Peter Kriens
Can you share a workspace where it does not work? It does work when I just 
tried it.

Kind regards,

Peter Kriens

> On 24 aug. 2016, at 13:44, manoj.vrajam...@wipro.com wrote:
> 
> Please help me out..I am stuck at this…  L
>  
> From: Manoj Venkatesh Rajamani (Product Engineering Service) 
> Sent: 24 August 2016 15:37
> To: OSGi Developer Mail List  >
> Subject: RE: [osgi-dev] Help
>  
> Why is POST not returning the Uppercase String? What am I missing here?
>  
> From: Manoj Venkatesh Rajamani (Product Engineering Service) 
> Sent: 24 August 2016 12:33
> To: OSGi Developer Mail List  >
> Subject: Re: [osgi-dev] Help
>  
>  
> public String getUpper(String string) {
> return string.toUpperCase();
> }
> 
> public String postUpper(String string) {
> return string.toUpperCase();
> }
>  
> //GET works..See below
>  
> manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello 
> 
> "HELLO"manoj@manoj-Latitude-E5420:~$ 
> 
> //POST fails...See below ( no error seen)
> 
> manoj@manoj-Latitude-E5420:~$ curl -X POST -H  
> "Content-Type:application/json"
>  -d "'Hello'" http://localhost:8080/rest/upper 
> 
> manoj@manoj-Latitude-E5420:~$ 
>  
> From: Manoj Venkatesh Rajamani (Product Engineering Service)
> Sent: 24 August 2016 10:44:27
> To: OSGi Developer Mail List
> Subject: RE: [osgi-dev] Help
>  
> postValue() did not work either !!
>  
> From: osgi-dev-boun...@mail.osgi.org  
> [mailto:osgi-dev-boun...@mail.osgi.org 
> ] On Behalf Of Peter Kriens
> Sent: 24 August 2016 10:43
> To: OSGi Developer Mail List  >
> Subject: Re: [osgi-dev] Help
>  
> ** This mail has been sent from an external source **
> You are doing a POST but you declared a PUT.
>  
> Kind regards,
>  
> Peter Kriens
>  
> On 24 aug. 2016, at 05:36, manoj.vrajam...@wipro.com 
>  wrote:
>  
> I inserted the following method in the existing class:
> 
> public String putValue(String string) {
> String status = string;
> return (status + " World");
> }
> 
> 2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value 
> 
> 
> 
> But got the following error:
> manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
> http://localhost:8080/rest/value 
> 
> 
> 
> Error 500 
> 
> 
> HTTP ERROR: 500
> Problem accessing /rest/value. Reason:
> java.io.FileNotFoundException: No such method postvalue/0. 
> Available: {getservletname/0=[getservletname/0], 
> getinitparameternames/0=[getinitparameternames/0], 
> getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
> getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
> getservletcontext/0=[getservletcontext/0], 
> getservletinfo/0=[getservletinfo/0], getservletconfig/0=[getservletconfig/0], 
> putvalue/0=[putvalue/0]}
> Powered by Jetty://
> 
> 
>  
> From: osgi-dev-boun...@mail.osgi.org  
> > on 
> behalf of David Leangen >
> Sent: 23 August 2016 17:56:18
> To: OSGi Developer Mail List
> Subject: Re: [osgi-dev] Help
>  
> ** This mail has been sent from an external source **
>  
> Hi Manoj,
>  
> It is similar to get. The java method name starts with the http method name, 
> so for instance putUpper() etc.
>  
> The test cases in this project should help:
>  
>   
> https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test
>  
> 
>  
>  
> Cheers,
> =David
>  
>  
>  
> On Aug 23, 2016, at 8:36 PM,  >  > wrote:
>  
> Hi All,
>  
> The Enroute Quick Start Tutorial sample application helps to invoke the “GET” 
> HTTP method by adding methods preceding with “get” like getUpper(), 
> getStatus() and so on. to the Application class. 
>  
> I am trying to test using curl on a Linux terminal. GET works fine.
>  
> Now,
>  
> I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST 
> API application.
>  
> What should I do?  Please suggest…
>  
> Thanks,
> Manoj
> The information contained in this electronic message and any attachments to 
> this message are intended for the exclusive use of the addressee(s) and 

Re: [osgi-dev] Help

2016-08-24 Thread Daghan ACAY
Monaj,


Run curl with debug, this might help 
http://stackoverflow.com/questions/866946/how-can-i-see-the-request-headers-made-by-curl-when-sending-a-request-to-the-ser


Or use a more user friendly rest client such as Postman 
(https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en).
 You can also start Enroute appliation in debug mode and see of the call is 
routed to your post method.

[https://lh4.googleusercontent.com/Dfqo9J42K7-xRvHW3GVpTU7YCa_zpy3kEDSIlKjpd2RAvVlNfZe5pn8Swaa4TgCWNTuOJOAfwWY=s128-h128-e365]

Postman
chrome.google.com
Supercharge your API workflow with Postman! Build, test, and document your APIs 
faster. More than a million developers already do.…


[http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]

How can I see the request headers made by curl when 
...
stackoverflow.com
I want to see the request headers made by curl when I am sending a request to 
the server. How can I check that?





From: osgi-dev-boun...@mail.osgi.org  on behalf 
of manoj.vrajam...@wipro.com 
Sent: Wednesday, August 24, 2016 11:44 AM
To: osgi-dev@mail.osgi.org
Subject: Re: [osgi-dev] Help


Please help me out..I am stuck at this…  :(



From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 15:37
To: OSGi Developer Mail List 
Subject: RE: [osgi-dev] Help



Why is POST not returning the Uppercase String? What am I missing here?



From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 12:33
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help





public String getUpper(String string) {
return string.toUpperCase();
}

public String postUpper(String string) {
return string.toUpperCase();
}



//GET works..See below



manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello
"HELLO"manoj@manoj-Latitude-E5420:~$

//POST fails...See below ( no error seen)

manoj@manoj-Latitude-E5420:~$ curl -X POST -H 

 "Content-Type:application/json" -d "'Hello'" http://localhost:8080/rest/upper
manoj@manoj-Latitude-E5420:~$





From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 10:44:27
To: OSGi Developer Mail List
Subject: RE: [osgi-dev] Help



postValue() did not work either !!



From: osgi-dev-boun...@mail.osgi.org 
[mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **

You are doing a POST but you declared a PUT.



Kind regards,



Peter Kriens



On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:



I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:

manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://







From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **



Hi Manoj,



It is similar to get. The java method name starts 

Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
Please help me out..I am stuck at this...  :(

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 15:37
To: OSGi Developer Mail List 
Subject: RE: [osgi-dev] Help

Why is POST not returning the Uppercase String? What am I missing here?

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 12:33
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help



public String getUpper(String string) {
return string.toUpperCase();
}

public String postUpper(String string) {
return string.toUpperCase();
}



//GET works..See below


manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello
"HELLO"manoj@manoj-Latitude-E5420:~$

//POST fails...See below ( no error seen)

manoj@manoj-Latitude-E5420:~$ curl -X POST -H 

 "Content-Type:application/json" -d "'Hello'" http://localhost:8080/rest/upper
manoj@manoj-Latitude-E5420:~$


From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 10:44:27
To: OSGi Developer Mail List
Subject: RE: [osgi-dev] Help


postValue() did not work either !!



From: osgi-dev-boun...@mail.osgi.org 
[mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **

You are doing a POST but you declared a PUT.



Kind regards,



Peter Kriens



On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:



I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:

manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://







From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **



Hi Manoj,



It is similar to get. The java method name starts with the http method name, so 
for instance putUpper() etc.



The test cases in this project should help:



  
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test





Cheers,

=David







On Aug 23, 2016, at 8:36 PM, 
> 
> wrote:



Hi All,



The Enroute Quick Start Tutorial sample application helps to invoke the "GET" 
HTTP method by adding methods preceding with "get" like getUpper(), getStatus() 
and so on. to the Application class.



I am trying to test using curl on a Linux terminal. GET works fine.



Now,



I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST API 
application.



What should I do?  Please suggest...



Thanks,

Manoj

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev




Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
Why is POST not returning the Uppercase String? What am I missing here?

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 12:33
To: OSGi Developer Mail List 
Subject: Re: [osgi-dev] Help



public String getUpper(String string) {
return string.toUpperCase();
}

public String postUpper(String string) {
return string.toUpperCase();
}



//GET works..See below


manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello
"HELLO"manoj@manoj-Latitude-E5420:~$

//POST fails...See below ( no error seen)

manoj@manoj-Latitude-E5420:~$ curl -X POST -H 

 "Content-Type:application/json" -d "'Hello'" http://localhost:8080/rest/upper
manoj@manoj-Latitude-E5420:~$


From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 10:44:27
To: OSGi Developer Mail List
Subject: RE: [osgi-dev] Help


postValue() did not work either !!



From: osgi-dev-boun...@mail.osgi.org 
[mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **

You are doing a POST but you declared a PUT.



Kind regards,



Peter Kriens



On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:



I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:

manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://







From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **



Hi Manoj,



It is similar to get. The java method name starts with the http method name, so 
for instance putUpper() etc.



The test cases in this project should help:



  
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test





Cheers,

=David







On Aug 23, 2016, at 8:36 PM, 
> 
> wrote:



Hi All,



The Enroute Quick Start Tutorial sample application helps to invoke the "GET" 
HTTP method by adding methods preceding with "get" like getUpper(), getStatus() 
and so on. to the Application class.



I am trying to test using curl on a Linux terminal. GET works fine.



Now,



I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST API 
application.



What should I do?  Please suggest...



Thanks,

Manoj

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended 

Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani

public String getUpper(String string) {
return string.toUpperCase();
}

public String postUpper(String string) {
return string.toUpperCase();
}


//GET works..See below



manoj@manoj-Latitude-E5420:~$ curl http://localhost:8080/rest/upper/Hello
"HELLO"manoj@manoj-Latitude-E5420:~$

//POST fails...See below ( no error seen)

manoj@manoj-Latitude-E5420:~$ curl -X POST -H "Content-Type:application/json" 
-d "'Hello'" http://localhost:8080/rest/upper
manoj@manoj-Latitude-E5420:~$



From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 10:44:27
To: OSGi Developer Mail List
Subject: RE: [osgi-dev] Help


postValue() did not work either !!



From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] On 
Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **

You are doing a POST but you declared a PUT.



Kind regards,



Peter Kriens



On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:



I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:

manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://







From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help



** This mail has been sent from an external source **



Hi Manoj,



It is similar to get. The java method name starts with the http method name, so 
for instance putUpper() etc.



The test cases in this project should help:



  
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test





Cheers,

=David







On Aug 23, 2016, at 8:36 PM, 
> 
> wrote:



Hi All,



The Enroute Quick Start Tutorial sample application helps to invoke the “GET” 
HTTP method by adding methods preceding with “get” like getUpper(), getStatus() 
and so on. to the Application class.



I am trying to test using curl on a Linux terminal. GET works fine.



Now,



I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST API 
application.



What should I do?  Please suggest…



Thanks,

Manoj

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 

Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
I have the same code as below... But I am *NOT* able to get back the return 
string (in the method)
It just directly goes to the prompt without any error...
Is there a way to debug the POST request?


-Original Message-
From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] On 
Behalf Of Peter Kriens
Sent: 24 August 2016 11:57
To: OSGi Developer Mail List 
Subject: Re: [osgi-dev] Help

** This mail has been sent from an external source **

You must give it a JSON value:


public String postUpper(String s) {
return s.toUpperCase();
}

curl -X POST -H “Content-Type: application/json" -d '"hello"' 
http://localhost:8080/rest/upper
HELLO$

There is a new version in progress that will be able to help a bit more with 
this.

Then again, this REST API is a simple support for your Javascript code to call 
Java. If you need more control over your REST then a JAX-RS solution might be 
better.

Kind regards,

Peter Kriens


> On 24 aug. 2016, at 05:36, manoj.vrajam...@wipro.com wrote:
>
> I inserted the following method in the existing class:
>
> public String putValue(String string) {
> String status = string;
> return (status + " World");
> }
>
> 2. Tried calling curl --data "param1=Hello"
> http://localhost:8080/rest/value
>
>
> But got the following error:
>
> manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello"
> http://localhost:8080/rest/valuehttp-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
> Error 500 
> 
> 
> HTTP ERROR: 500
> Problem accessing /rest/value. Reason:
> java.io.FileNotFoundException: No such method postvalue/0. 
> Available: {getservletname/0=[getservletname/0], 
> getinitparameternames/0=[getinitparameternames/0], 
> getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
> getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
> getservletcontext/0=[getservletcontext/0], 
> getservletinfo/0=[getservletinfo/0], getservletconfig/0=[getservletconfig/0], 
> putvalue/0=[putvalue/0]}
> Powered by Jetty://  
>
> From: osgi-dev-boun...@mail.osgi.org 
> on behalf of David Leangen 
> Sent: 23 August 2016 17:56:18
> To: OSGi Developer Mail List
> Subject: Re: [osgi-dev] Help
>
> ** This mail has been sent from an external source **
>
> Hi Manoj,
>
> It is similar to get. The java method name starts with the http method name, 
> so for instance putUpper() etc.
>
> The test cases in this project should help:
>
>
> https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.
> rest.simple.test
>
>
> Cheers,
> =David
>
>
>
>> On Aug 23, 2016, at 8:36 PM,  
>>  wrote:
>>
>> Hi All,
>>
>> The Enroute Quick Start Tutorial sample application helps to invoke the 
>> “GET” HTTP method by adding methods preceding with “get” like getUpper(), 
>> getStatus() and so on. to the Application class.
>>
>> I am trying to test using curl on a Linux terminal. GET works fine.
>>
>> Now,
>>
>> I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST 
>> API application.
>>
>> What should I do?  Please suggest…
>>
>> Thanks,
>> Manoj
>> The information contained in this electronic message and any
>> attachments to this message are intended for the exclusive use of the
>> addressee(s) and may contain proprietary, confidential or privileged
>> information. If you are not the intended recipient, you should not
>> disseminate, distribute or copy this e-mail. Please notify the sender
>> immediately and destroy all copies of this message and any
>> attachments. WARNING: Computer viruses can be transmitted via email.
>> The recipient should check this email and any attachments for the
>> presence of viruses. The company accepts no liability for any damage
>> caused by any virus transmitted by this email. www.wipro.com
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain proprietary, confidential or privileged
> information. If you are not the intended recipient, you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately and destroy all copies of this message and any
> attachments. WARNING: Computer viruses can be transmitted via email.
> The recipient should check this email and any attachments for the
> presence of viruses. The company accepts no liability for any damage
> caused by any virus transmitted by this email. www.wipro.com
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] Help

2016-08-24 Thread Peter Kriens
You must give it a JSON value:


public String postUpper(String s) {
return s.toUpperCase();
}

curl -X POST -H “Content-Type: application/json" -d '"hello"' 
http://localhost:8080/rest/upper
HELLO$

There is a new version in progress that will be able to help a bit more with 
this.

Then again, this REST API is a simple support for your Javascript code to call 
Java. If you need more control over your REST then a JAX-RS solution might be 
better.

Kind regards,

Peter Kriens


> On 24 aug. 2016, at 05:36, manoj.vrajam...@wipro.com wrote:
> 
> I inserted the following method in the existing class:
> 
> public String putValue(String string) {
> String status = string;
> return (status + " World");
> }
> 
> 2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value
> 
> 
> But got the following error:
> 
> manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
> http://localhost:8080/rest/value
> 
> 
> 
> Error 500 
> 
> 
> HTTP ERROR: 500
> Problem accessing /rest/value. Reason:
> java.io.FileNotFoundException: No such method postvalue/0. 
> Available: {getservletname/0=[getservletname/0], 
> getinitparameternames/0=[getinitparameternames/0], 
> getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
> getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
> getservletcontext/0=[getservletcontext/0], 
> getservletinfo/0=[getservletinfo/0], getservletconfig/0=[getservletconfig/0], 
> putvalue/0=[putvalue/0]}
> Powered by Jetty://
> 
> 
> 
> From: osgi-dev-boun...@mail.osgi.org  on 
> behalf of David Leangen 
> Sent: 23 August 2016 17:56:18
> To: OSGi Developer Mail List
> Subject: Re: [osgi-dev] Help
>  
> ** This mail has been sent from an external source **
> 
> Hi Manoj,
> 
> It is similar to get. The java method name starts with the http method name, 
> so for instance putUpper() etc.
> 
> The test cases in this project should help:
> 
>   
> https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test
> 
> 
> Cheers,
> =David
> 
> 
> 
>> On Aug 23, 2016, at 8:36 PM,  
>>  wrote:
>> 
>> Hi All,
>>  
>> The Enroute Quick Start Tutorial sample application helps to invoke the 
>> “GET” HTTP method by adding methods preceding with “get” like getUpper(), 
>> getStatus() and so on. to the Application class. 
>>  
>> I am trying to test using curl on a Linux terminal. GET works fine.
>>  
>> Now,
>>  
>> I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST 
>> API application.
>>  
>> What should I do?  Please suggest…
>>  
>> Thanks,
>> Manoj
>> The information contained in this electronic message and any attachments to 
>> this message are intended for the exclusive use of the addressee(s) and may 
>> contain proprietary, confidential or privileged information. If you are not 
>> the intended recipient, you should not disseminate, distribute or copy this 
>> e-mail. Please notify the sender immediately and destroy all copies of this 
>> message and any attachments. WARNING: Computer viruses can be transmitted 
>> via email. The recipient should check this email and any attachments for the 
>> presence of viruses. The company accepts no liability for any damage caused 
>> by any virus transmitted by this email. www.wipro.com 
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> The information contained in this electronic message and any attachments to 
> this message are intended for the exclusive use of the addressee(s) and may 
> contain proprietary, confidential or privileged information. If you are not 
> the intended recipient, you should not disseminate, distribute or copy this 
> e-mail. Please notify the sender immediately and destroy all copies of this 
> message and any attachments. WARNING: Computer viruses can be transmitted via 
> email. The recipient should check this email and any attachments for the 
> presence of viruses. The company accepts no liability for any damage caused 
> by any virus transmitted by this email. www.wipro.com 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Help

2016-08-24 Thread manoj.vrajamani
Basically, how do I confirm that the server received the POST data as expected?

From: Manoj Venkatesh Rajamani (Product Engineering Service)
Sent: 24 August 2016 11:22
To: OSGi Developer Mail List 
Subject: RE: [osgi-dev] Help


· Now, I am *NOT* getting the function to return the string…  The post 
or put request is, as if, it does nothing…just comes back to the prompt again….

· Can I enable any prints in the function like System.out.println ?

From: osgi-dev-boun...@mail.osgi.org 
[mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Peter Kriens
Sent: 24 August 2016 10:43
To: OSGi Developer Mail List 
>
Subject: Re: [osgi-dev] Help


** This mail has been sent from an external source **
You are doing a POST but you declared a PUT.

Kind regards,

Peter Kriens

On 24 aug. 2016, at 05:36, 
manoj.vrajam...@wipro.com wrote:

I inserted the following method in the existing class:

public String putValue(String string) {
String status = string;
return (status + " World");
}

2. Tried calling curl --data "param1=Hello" http://localhost:8080/rest/value


But got the following error:
manoj@manoj-Latitude-E5420:~$ curl --data "param1=Hello" 
http://localhost:8080/rest/value



Error 500 


HTTP ERROR: 500
Problem accessing /rest/value. Reason:
java.io.FileNotFoundException: No such method postvalue/0. Available: 
{getservletname/0=[getservletname/0], 
getinitparameternames/0=[getinitparameternames/0], 
getinitparameter/1=[getinitparameter/1], getstatus/1=[getstatus/1], 
getsetvalue/1=[getsetvalue/1], getupper/1=[getupper/1], 
getservletcontext/0=[getservletcontext/0], getservletinfo/0=[getservletinfo/0], 
getservletconfig/0=[getservletconfig/0], putvalue/0=[putvalue/0]}
Powered by Jetty://




From: osgi-dev-boun...@mail.osgi.org 
> on 
behalf of David Leangen >
Sent: 23 August 2016 17:56:18
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Help

** This mail has been sent from an external source **

Hi Manoj,

It is similar to get. The java method name starts with the http method name, so 
for instance putUpper() etc.

The test cases in this project should help:

  
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.test


Cheers,
=David



On Aug 23, 2016, at 8:36 PM, 
> 
> wrote:

Hi All,

The Enroute Quick Start Tutorial sample application helps to invoke the “GET” 
HTTP method by adding methods preceding with “get” like getUpper(), getStatus() 
and so on. to the Application class.

I am trying to test using curl on a Linux terminal. GET works fine.

Now,

I would like to try other HTTP methods (like PUT,POST, DELETE) on this REST API 
application.

What should I do?  Please suggest…

Thanks,
Manoj
The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

The information contained in this electronic message and any attachments to 
this