Hi All,
We have a project where the customer really doesn't want to go the full
REST route. We are basically migrating a Corba IDL interface with 100+
functions over to web services and they want a generic URL to send requests
through to.
For the new implementation, I want to implement the following scheme:
/rest/function/function1?params=..
/rest/function/functionN?params=..
This way each function can be mapped directly to the the servicing
component, where each component is in a different class. . However from
what I'm seeing, if the root resource is "function" for example, the
resource component servicing the request may not be in a different
implementing class. When I call the URL in the second function, I get "No
operation matching request path "/RestTest/rest/function/functionN" Is this
the expected behaviour?
I know I'm fighting against the way JAX-RS was meant to be used, but is
there a way the above scheme can be made to work?
Regards
Kiren
=================================================
@Service("testService")
public class MyRestTest {
@GET
@Produces("text/xml")
@Path("/function")
public MyType dummyFunction(){
MyType mt=new MyType();
mt.key="key";
mt.value=
"OKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK";
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return mt;
}
===========================================================
@Service("otherService")
@Path("/function")
public class OtherService {
@GET
@Produces("text/xml")
@Path("/functionN")
public MyType dummyFunction(){
MyType mt=new MyType();
mt.key="key";
mt.value= "Other";
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return mt;
}
}