Exposing REST service as EJB 3.1 method

How to convert Restful WebService (RestEasy) to EJB 3.1 Stateless session bean
In my current project we are using Restful Web Services (Resteasy) combined with Jpos and Jcard with an ISO-8583 message format. The task is to remove all the dependencies of resteasy,jpos and jcard and implement it through EJB 3.1 stateless beans for the current functionality.
I have seached / googled all over the net with regard to how to proceed but unluckily no success till yet.
Would be grateful if any one can provide any pointers / suggestions / demo code for the same.
Please Note - Its a already developed module in Restful + jpos + jcard .. is it possible to convert restful webservice to ejb 3.1 stateless beans ..using jboss server..

I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
Edited by: asarkar on Jul 24, 2011 2:45 PM

Similar Messages

  • RESTful service with EJB 3.1 endpoint cannot be found (404)

    Hi,
    I have a Resource configured as a EJB 3.1 Stateless Bean. I also have an overridden Application class to customize the context root. However, the client just cannot seem to find the Resource. What am I doing wrong? The Resource is packaged and deployed as a war.
    Cross posted: http://www.coderanch.com/t/546565/java-Web-Services-SCDJWS/certification/RESTful-service-EJB-endpoint-cannot#2480046
    Tests in error:
      testSendRequestAndGetGreeting(name.app.abhi.helloworld.ejb.restful.client.HelloWorldEjbRestfulClientTest): GET http://localhost:9090/practice/helloworld?name=Duke returned a response status of 404 Not Found
    Resource:
    @Path("helloworld")
    @Stateless
    public class HelloWorldBean {
        @GET
        @Produces("text/plain")
        public String getQuintessentialGreeting(@QueryParam("name") String name) {
         if (name == null) {
             throw new WebApplicationException(Response.Status.BAD_REQUEST);
         return "Say hello to the world, " + name;
    Application class:
    @ApplicationPath("practice")
    public class ApplicationConfig extends Application {
        @Override
        public Set<Class<?>> getClasses() {
         Set<Class<?>> clazzez = super.getClasses();
         if (clazzez == null) {
             clazzez = new HashSet<Class<?>>();
         clazzez.add(name.app.abhi.helloworld.ejb.restful.service.HelloWorldBean.class);
         return clazzez;
    Client:
    public class HelloWorldEjbRestfulClient {
        private final static String ENDPOINT_URI = "http://localhost:9090/"
             + "practice/helloworld";
        public String sendRequestAndGetGreeting(String name) {
         Client client = Client.create();
         WebResource webResource = client.resource(ENDPOINT_URI);
         webResource.accept(MediaType.TEXT_PLAIN);
         return webResource.queryParam("name", name).get(java.lang.String.class);
    }Edited by: asarkar on Jul 24, 2011 12:20 PM

    I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
    The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
    Edited by: asarkar on Jul 24, 2011 2:45 PM

  • Expose REST service in PI

    Hi all,
    I kindly ask if it's possible to expose a REST web service with PI to be called from an external application.
    I've created many scenarios in wich I created a SOAP service (from service interface) in PI and I was able to call the service from an external application (e.g. SOAPUi).
    Is it possible to make the same thing exposing a REST service (the url should contain parameters).
    I've seen some discussions and blogs with examples of usage of "SOAP Axis" but it seems it's be possible only to invoke an external service.
    Is it possible also to create a REST web-service?
    If yes could you please provide examples or step-by-step procedure?
    Thanks in advance for any help.
    Stefano.

    Hi Stefano,
    please check the below link where REST adapter key features.
    >>>I kindly ask if it's possible to expose a REST web service with PI to be called from an external application.
    It can be used to expose internal applications as REST services or to consume external REST services by calling these services from SAP PI.
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/11/08/rest-adapter-for-netweaver-sap-pi
    Thanks and Regards,
    Naveen    

  • Exposing rest services in custom managed server

    Hi everybody,
    I want to know how can expose the rest sevices for custom managed server which is created from webcenter custom portal template ????
    Thanks.

    I mean that once i deployed my custom webcenter portal (including web 2.0 services) into managed server. it is possible or not to manage potal services (documents, discussions ..) through rest api using thz following URL: http://myManagedServer:myPort/rest/api/resourceIndex ????

  • Exposing REST Service in Oracle SOA 10g.

    Hi,
    I have a requirement to expose a REST web service. The environment im working on is Oracle SOA 10.1.3.4.
    Please let me know the way of doing the same.
    Thanks.
    Edited by: user577285 on Sep 24, 2012 10:01 AM

    Yes, it's clear now...
    I would say you will have to maintain both infrastructure for a while...
    You can proxy the external web service entry points via OSB as I told you before, this way you can migrate the services from .NET to Oracle SOA gradually without affecting your customers, as they will always point to Oracle SOA, never to .NET infra.
    Cheers,
    Vlad
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts)
    https://forums.oracle.com/forums/ann.jspa?annID=893

  • HTTP Adapter and Other Approaches to Call REST services

    Hi,
    We are coming up with a BPEL process to call the REST service using GET and POST methods. When i tried using HTTP adapter, we have got the error REPLACE_WITH_ACTUAL_URL so we went to another approach given in the blog https://blogs.oracle.com/reynolds/entry/oracle_http_adapter.
    This is working fine in BPEL 10g, when we did in the same way in 11g and tried to test we are getting the NullPointerException. Following is the error trace that is shown in the diagnostic log file. Please do let me know if anybody faced this issue and have insight on the same.
    java.lang.NullPointerException
    at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
    at java.util.regex.Matcher.reset(Matcher.java:291)
    at java.util.regex.Matcher.<init>(Matcher.java:211)
    at java.util.regex.Pattern.matcher(Pattern.java:888)
    at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.request(WebServiceExternalBindingComponent.java:557)
    at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139)
    at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:182)
    at oracle.integration.platform.blocks.mesh.MeshImpl.request(MeshImpl.java:154)
    at sun.reflect.GeneratedMethodAccessor1172.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:71)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy327.request(Unknown Source)
    at oracle.fabric.CubeServiceEngine.requestToMesh(CubeServiceEngine.java:820)
    at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:263)
    at com.collaxa.cube.engine.ext.common.InvokeHandler.__invoke(InvokeHandler.java:1059)
    at com.collaxa.cube.engine.ext.common.InvokeHandler.handleNormalInvoke(InvokeHandler.java:586)
    at com.collaxa.cube.engine.ext.common.InvokeHandler.handle(InvokeHandler.java:130)
    at com.collaxa.cube.engine.ext.bpel.common.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:74)
    at com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform(BaseBPELActivityWMP.java:158)
    at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:2543)
    at com.collaxa.cube.engine.CubeEngine._handleWorkItem(CubeEngine.java:1165)
    at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1071)
    at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:73)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:220)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:328)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4430)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4361)
    at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:698)
    at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:555)
    at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:673)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:293)
    at sun.reflect.GeneratedMethodAccessor1166.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:81)
    at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:112)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:105)
    at sun.reflect.GeneratedMethodAccessor1064.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

    I tried using the HTTP adapter which is the straight forward way for calling the REST based services. But when we use XSD complex type we are getting the error REPLACE_WITH_ACTUAL_URL. We have to use GET method. when we tried from the browser it's working fine as expected but erroring out from BPEL.

  • How to call rest service with POST Http method in SMP2.3 HWC?

    Hi Experts,
       I am doing a sample for Rest Service in smp.
    http://192.168.1.119:8086/Test/services/Products
    I am calling the above service in the smp it is pulling the data from the service with GET Http Method.
    Now i want to call this service for login functionality.
    http://192.168.1.119:8086/Test/services/auth?uname=:uname&pass=:pass
    here :uname &:pass values are argument values for the uname & pass.
    the output of the service is
    http://192.168.1.119:8086/Test/services/auth?uname=sravanya.k&pass=sravanya
    <?xml version="1.0" encoding="UTF-8"?>
    <details>
    <responsecode>200</responsecode>
    <profile>
    <firstname>sravanya</firstname>
    <lastname>k</lastname>
    <email>[email protected]</email>
    <chart_type>North</chart_type>
    <location>MACHILIPATNAM</location>
    <language>English</language>
    </profile>
    </details>
    How can i do this?
    Thanks & Regards,
    Sravanya K

    Create a uriTemplate like this
    /auth?uname={uname}&pass={pass}
    use GET method only.
    generate the personalization keys.

  • Do SMP3.0 supports JSON based RESTful services exposed via JBOSS server??

    Hi All,
    We are working on a PoC for a customer to consume JSON based RESTful (exposed via JBOSS Server) service from SMP 3.0. We were not able to get the DataSet. the below are the steps which we performed and the respective result.
    1) Created a SMP Application - Able to ping the application with the base URL
    2) Tested the connections - Able to create a Registration using Firefox POSTMAN client
    3) Data Consumption from the service - We are not able to get the response for the service when we try the same via SMP,but we are able to get the data when we try the REST service URL directly from the browser.
    How do we achieve this? Do SMP3.0 support JSON based RESTful service? Can Integration Gateway Help?
    Thanks, Prem

    hi Jitendra,
    attached are the screen shots of both SMP service from postman we tried and the original service from the browser.
    1- postman ping for SMP URL and header says success.
    2- Response body with entity set structure and empty data there is no data inside the collection named "Connection" as well and if i call this i fails with 501, that not implemented, so i guess SMP3 is unable to create the entity set out the JSON REST services while converting it into Odata service internally.
    3- i can view data if run directly the REST service from browser.

  • Expose soap service as rest in OSB

    Hi
    I need to expose a soap service (SOA Composite) in OSB as RESTful service; own customers send the documents in POST way. I am new in OSB.
    Thank you for your help.
    Andrés

    The task is not clear. The existing consumers do POST. Where the REST should be placed? Should the consumers switch to REST (GET/POST/PUT, relative URIs)? Or a backend service plans to switch to REST?
    A minor caution note: OSB 12 has a bug with DELETE and OPTIONS(? don't remember the second one) operations when calling a REST backend: Those have empty body, but OSB still sends encoding as "chunked". The backend waits for the first chunk size, and OSB waits for a response from the backend => timeout.
    Vlad.

  • RESTful Service: Expose BLOB file inside DB as RESTful service ??

    Hello,
    With Oracle Cloud we can expose the Data as RESTful Web Service, but how about exposing BLOB... we need to generate a link for that file which is stored in the DB.
    To make it clearer:
    Two Tables:
    Properties (Property_ID number PK, Project varchar2(40), Property_number varchar2(20) ...)
    Images  (ID number PK, Property_ID number FK, content blob,
    mimetype varchar2(200), filename varchar2 (200), filesize varchar2 (200))And I would like to expose this query as RESTful :
    Select p.property_id, p.project, p.property_number, i.content
    from properties p inner join images i on (p.property_id = i.property_id)Usually we use: [url http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm#CHDICGDA] apex_util.get_blob_file_src  , but that one should be called from a valid apex session !!!!! ( in that query "i.content" should give a link.)
    How can we do it ???
    Another point, since we expose the data as JSON:
    Suppose I have a property with 10 images, then it does not make sense to get 10 rows fro the same property just to give different image. I think we need another level (nested level) for images !!!
    I hope that my point is clear,
    Thanks in advance ....
    Fateh

    Hi Fateh -
    Good question. You would identify the source type as a Media Resource, and use an SQL statement with the primary key and the BLOB column. When you use Media Resource, you are essentially telling your Database Cloud Service not to marshall the data, just to send it - which is exactly what you are looking for.
    With this implementation, you would have to have a separate SQL call for each BLOB retrieval. However, you might be able to use a PL/SQL block as the end point for the RESTful Service and take care of multiple BLOB processing in the block.
    Hope this helps.
    - Rick Greenwald

  • Expose Orchestration as RESTful service in Biztalk Server 2013

    Hello all,
    I am having BizTalk application (orchestration)where I am receiving few info and sending it back some info to requestor.
    I want to expose this orchestration as RESTful service, to do that I know we can use BiztTalk WCF Publishing wizard and select "WCF Web Http" but what needs to add in other fields ? can some one tell me ?
    or point me to some example...
    Note : I tried this example but no use ......http://seroter.wordpress.com/2012/11/12/exploring-rest-capabilities-of-biztalk-server-2013-part-1-exposing-rest-endpoints/
    Thanks,
    Nilesh Thakur.
    Thanks and Regards, Nilesh Thakur.

    Hi Nilesh,
    I have do it by following way .Links are listed below
    http://code.msdn.microsoft.com/BizTalk-Server-2013-WCF-e3e4a4f9
    http://vikasbhardwaj15.blogspot.co.uk/2014/01/publish-rest-service-from-biztalk-server.html#!/2014/01/publish-rest-service-from-biztalk-server.html
    Thanks
    Abhishek

  • BPEL service(SOAP) expose as RESTFul Service through OSB

    I am trying to invoke simple HelloWorld BPEL process exposed as SOAP Web Service through OSB as RESTFul service but always getting XML parsing exception in response action.
    Could any body give me steps how to implement it?
    Thanks
    Edited by: user10475179 on Dec 4, 2011 9:44 PM

    Thanks for your reply. I was able to manage to get xml, is there a simple way with simple steps to use JSON? If you have any steps/screenshots I would appreciate.
    Thanks
    Edited by: user10475179 on Dec 6, 2011 2:24 PM

  • Rest Service method called twice in wcf

    Hi all,
    I have created a rest service using wcf.
    I am writing Entity framework code within a service method to fetch data from database.
    Every call from browser is hitting the service method twice or thrice.
    I found no exception within the method. I encountered same problem before and solved it adding DataContract attribute to all the models(not helping now).
    What may be the possible reasons? Please help.
    Regards
    Ashish

    Hi,
    I want to know if you are using the WebGet (Http GET). If so, please try to change that API to WebInvoke (Http POST).
    Because IIS has some setting for HTTP GET as 40sec replay, so if within 40sec the server does not get response, then it will query itself again. Then it will be called twice or more.
    For more information, please try to refer to:
    #RESTful API in WCF get called more than one time:
    http://www.codeproject.com/Tips/338142/RESTful-API-in-WCF-get-called-more-than-one-time-b .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Expose SOA component as Rest Service

    Hi,
    Is there a example to show how to expose SOA component as Rest Service using Http Binding adapter ?
    or
    How to call Rest Service from BPEL/Composite application ?
    Thanks,
    Naveen
    Edited by: 975104 on Dec 21, 2012 1:57 AM

    Please refer Real Web Services with REST and ICF for creation of rest services in sap. The BAPI will have to be called in your handler class.
    I think your best bet would be to transfer the data in the body of the http request and use simple transformation(with multiple roots) to convert the xml data to sap formats. GZIP can also be used to compress the data that is being sent. We have done this successfully in one of our projects.
    However this approach(RESTful Service) would involve more work when compared to the approach suggested by Vikram. If SOAP based services are ok, then you should go ahead with Vikram's approach.

  • Is exposing ADF BC as RESTFul service supported by current JDev?

    According to the presentation at http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adf-service-integ/adf-service-integ.html, Frank mentioned that Jdev will support RESTFul services for ADF BC in future. Is it available now? If no then is there any tentative version number when it might be available?

    Hi Frank
    Is this why the "ADF Model RESTful WebService Project" option in the New Gallery is greyed out in the 12.1.2c version of JDev.
    Eddie

Maybe you are looking for

  • Using icloud mail - multiple devices

    Hi there. I'm using an iPad, Macbook Air and iPhone, all linked to the same icloud account. All works perfectly except for one thing, when I delete mail on either the iPad/iPhone, they aren't deleted from the Mail program on the Macbook but are delet

  • Removing multiple entries in the 'Open With' menu

    When I right mouse click on a file, I get the Open With option. On selecting this I get a huge list of options - a lot of them duplicates. How do I remove them?

  • Adobe Revel and Elements 11

    i am totally confused with the 'new' revel; i put the free app on my iphone, but i do not use my phone for editing pics, i use a dell laptop w/older version of elements (7). how do i get my photos that are stored on my laptop to go to revel; i spoke

  • Alias Tables on Data Forms

    I am wondering if in Hyperion Planning has the capability to use custom alias table on data forms, right now we use the default alias on our forms. I want to use our "short name" alias on data forms so that our department name are not so long. Is thi

  • Mouse Rollover pop-ups

    Greetings; I'm using Dreamweaver 8 and to this date, I still haven't put up a Web Site yet; I want to perfect my Dreamweaver knowledge a lot more first. My question (or problem) now is as follows: I created a Flash video and inserted it into a Dreamw