[jpos-users] Cant eat my own dog food

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jpos-users] Cant eat my own dog food

mrtechit
Hi,

I tried to create a REST service which accepts an http request and want to pass the isomsg to my switch.

@Path("/customers")
public class RestSupportTest {
   
        @POST
        @Produces(MediaType.APPLICATION_JSON)
        @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
        public Response credit (
                @Context UriInfo uriInfo,
                @PathParam("customer_id") String customerId,
                @PathParam("wallet_id") String walletId,
                @FormParam("rrn") String rrn,
                @FormParam("detail") String detail,
                @FormParam("amount") BigDecimal amount,
                @FormParam("currency") String currency)
                throws IOException, URISyntaxException, BLException, ISOException
        {
            System.out.println("Test");
            return Response.status(204).build();
        }          
}

Can someone help me how to publish this service ?
Also, how do i pass the message to an already implemented and working switch ( trxn mngr)

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2a79d75f-14f0-4e7c-b0bc-7b14f6ca9b4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

chhil

We use embedded jetty that runs in the same process as the switch.  Jetty is part of jpos ee.

Once you have the request,  you just have to put it on your transaction managers queue to process it and place the response in a queue that your web request handler waits on.

-chhil


On Tue, Jan 31, 2017, 7:42 PM Anirudh Singh <[hidden email]> wrote:
Hi,

I tried to create a REST service which accepts an http request and want to pass the isomsg to my switch.

@Path("/customers")
public class RestSupportTest {
   
        @POST
        @Produces(MediaType.APPLICATION_JSON)
        @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
        public Response credit (
                @Context UriInfo uriInfo,
                @PathParam("customer_id") String customerId,
                @PathParam("wallet_id") String walletId,
                @FormParam("rrn") String rrn,
                @FormParam("detail") String detail,
                @FormParam("amount") BigDecimal amount,
                @FormParam("currency") String currency)
                throws IOException, URISyntaxException, BLException, ISOException
        {
            System.out.println("Test");
            return Response.status(204).build();
        }          
}

Can someone help me how to publish this service ?
Also, how do i pass the message to an already implemented and working switch ( trxn mngr)

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2a79d75f-14f0-4e7c-b0bc-7b14f6ca9b4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefDjLxRupfUFAX-PLSbAVufnjFm-%2B7W8_e_1dqa0Ro9TPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

Victor Salaman-Medina
In reply to this post by mrtechit
Hi:

Take a look at the 'eerest' module in jPOS-EE. That module uses Jersey, so you'll need to add additional dependencies for the CDI annotations to work.

/V

On Tue, Jan 31, 2017 at 9:12 AM, Anirudh Singh <[hidden email]> wrote:
Hi,

I tried to create a REST service which accepts an http request and want to pass the isomsg to my switch.

@Path("/customers")
public class RestSupportTest {
   
        @POST
        @Produces(MediaType.APPLICATION_JSON)
        @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
        public Response credit (
                @Context UriInfo uriInfo,
                @PathParam("customer_id") String customerId,
                @PathParam("wallet_id") String walletId,
                @FormParam("rrn") String rrn,
                @FormParam("detail") String detail,
                @FormParam("amount") BigDecimal amount,
                @FormParam("currency") String currency)
                throws IOException, URISyntaxException, BLException, ISOException
        {
            System.out.println("Test");
            return Response.status(204).build();
        }          
}

Can someone help me how to publish this service ?
Also, how do i pass the message to an already implemented and working switch ( trxn mngr)

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2a79d75f-14f0-4e7c-b0bc-7b14f6ca9b4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CALK1SyyETMhoZg3iHD-TR9ZPYb%3DP6EUBERo%3D8CpZgQevVQj0Tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

mrtechit
Hi,

Thanks for responding.

My jetty work fine and i have a SOAP web service running on it which works fine.

However, will i have to publish this rest service by adding a participant in the existing transaction manager ?

eg -

    <participant class="com.test.RestSupportTest"    logger="Q2">
             <property name="checkpoint" value="restService"/>
        </participant>

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

Alejandro Revilla

Remember your web.xml needs something like this:

    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>your.package.name</param-value>
    </init-param>

So that Jersey gets to scan your files for annotations.




On Tue, Jan 31, 2017 at 11:30 AM, Anirudh Singh <[hidden email]> wrote:
Hi,

Thanks for responding.

My jetty work fine and i have a SOAP web service running on it which works fine.

However, will i have to publish this rest service by adding a participant in the existing transaction manager ?

eg -

    <participant class="com.test.RestSupportTest"    logger="Q2">
             <property name="checkpoint" value="restService"/>
        </participant>

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3DmBPrdnSSmCmtxuiH5ZpzEiar62xzKDxVqjiWnND31Bpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

mrtechit
I still cant eat the food. Not even drink the water.

My SOAP services are published and working fine.

For Rest, I am thinking to use javax.ws.rs.*

However, i cant publish the service on the embedded jetty.

On Tuesday, January 31, 2017 at 6:54:18 PM UTC+3, Alejandro Revilla wrote:

Remember your web.xml needs something like this:

    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value><a href="http://your.package.name" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fyour.package.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE9dV_UhWi_jUKNa8Waem-XDwDyfQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fyour.package.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE9dV_UhWi_jUKNa8Waem-XDwDyfQ&#39;;return true;">your.package.name</param-value>
    </init-param>

So that Jersey gets to scan your files for annotations.



--
<a style="font-family:garamond,serif" href="http://twitter.com/apr" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Fapr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFRt8creb486OVHOJ12erdzV1NRIg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Fapr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFRt8creb486OVHOJ12erdzV1NRIg&#39;;return true;">@apr

On Tue, Jan 31, 2017 at 11:30 AM, Anirudh Singh <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="le-AvFNnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">anirudhsi...@...> wrote:
Hi,

Thanks for responding.

My jetty work fine and i have a SOAP web service running on it which works fine.

However, will i have to publish this rest service by adding a participant in the existing transaction manager ?

eg -

    <participant class="com.test.RestSupportTest"    logger="Q2">
             <property name="checkpoint" value="restService"/>
        </participant>

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="le-AvFNnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sa...@...
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="le-AvFNnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jpos-users+...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="le-AvFNnAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jpos-...@....
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/b3e7ed1e-5fc7-4ba1-86d1-36faaac88b00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

chhil
Hi,

I don't use web.xml (due to my wiring requirements) but use code to make the paths available.

      ResourceConfig visaResourceConfig = getResourceConfig();
        ServletHolder visaServletHolder = new ServletHolder(
                new ServletContainer(visaResourceConfig));
        contextHandler.addServlet(visaServletHolder, "/rest/rewards/*");




    private ResourceConfig getResourceConfig() {
        // manually injecting dependencies to Jersey resource classes
        return new ResourceConfig()
                .register(new StatementCreditSvc(visaRewardsTxnMgr,
                        new int[] { visaRewardPort },visaRewardsTimeOut))
                .register(new AuthenticationFilter(log))
                .register(new CustomLoggingFilter(log));
    }
The StatementCreditSvc has the path annotation for the url and I pass in the txn mgr queue property value to use.

-chhil


On Thu, Feb 2, 2017 at 7:59 AM, Anirudh Singh <[hidden email]> wrote:
I still cant eat the food. Not even drink the water.

My SOAP services are published and working fine.

For Rest, I am thinking to use javax.ws.rs.*

However, i cant publish the service on the embedded jetty.

On Tuesday, January 31, 2017 at 6:54:18 PM UTC+3, Alejandro Revilla wrote:

Remember your web.xml needs something like this:

    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>your.package.name</param-value>
    </init-param>

So that Jersey gets to scan your files for annotations.




On Tue, Jan 31, 2017 at 11:30 AM, Anirudh Singh <[hidden email]> wrote:
Hi,

Thanks for responding.

My jetty work fine and i have a SOAP web service running on it which works fine.

However, will i have to publish this rest service by adding a participant in the existing transaction manager ?

eg -

    <participant class="com.test.RestSupportTest"    logger="Q2">
             <property name="checkpoint" value="restService"/>
        </participant>

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/de12ab45-907c-4b59-93dd-a39ab65e0797%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/b3e7ed1e-5fc7-4ba1-86d1-36faaac88b00%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefCD83PyC2Qf4E9r9HBtCMOv%3DQRjm9x%2BmCvJWyqnDasPTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] Cant eat my own dog food

jPOS - Users mailing list
In reply to this post by mrtechit


On Thursday, February 2, 2017 at 1:59:25 PM UTC, Anirudh Singh wrote:
However, i cant publish the service on the embedded jetty.

Can't?

Have you tried and it fails?  How does it fail?
Do you not know where to start?
Something else?

--
Mark

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/8f721adc-6bf2-4154-852f-32fd94836a3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.