On 03/28/2013 11:56 AM, soumik.basu wrote:
Hi Seb, Sorry I got little tied up with some other stuff so
couldn't reply to
you earlier.
Though I could now hit the Rest service from my HTML page but it is not
returning any data.
*Rest Service code :*
@Path("/helloworld")
@RequestScoped
@Stateful
public class RSHelloWorld {
@GET
@Produces(MediaType.APPLICATION_JSON)
public String sayHello() {
System.out.println("i got hit");
return "Hello";
}
}
*JS code:*
var memberPipe = AeroGear.Pipeline([{
name: "helloworld",
settings: {
baseURL: "/JAX_RS_HelloWorld/"
}
} ]).pipes.helloworld;
alert(memberPipe);// *this alert is coming as [object object]*
function getRestData(){
subs = memberPipe.read({
success: function(data) {
MemberStore.save( data );
alert("in function" + data);
},
error: function(jqXHR,textStatus,errorThrown){
alert("jq" + jqXHR);
alert("err" + errorThrown);
alert("status" + textStatus);
}
});
var testData = MemberStore.read();
alert("testData" + testData);
}
Would appreciate if you can please guide me in it.
Regards
Soumik
Soumik,
You have specified your Media Type as JSON, but the string "Hello"
(without quotes) is not valid JSON. "Hello" (With quotes) is however.
Summers
--
View this message in context:
http://aerogear-dev.1069024.n5.nabble.com/aeroGear-pipeline-not-working-t...
Sent from the aerogear-dev mailing list archive at
Nabble.com.
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev