You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Marianne Hagaseth <Ma...@marintek.sintef.no> on 2015/05/13 10:33:28 UTC

Setting up REST client ISIS 1.9.0: Guideline?

A simple question:
Where can I find a guideline for how to set up a REST web client in Apache ISIS?
I mean, just having a button which calls a REST web service using simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?

And what is best to use to generate the class files from the xsd fetched from the REST web service? Apache axis2?  cxf?

Using Eclipse, ISIS 1.9.0, and wicket viewer.

Best,
Marianne.

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker - Maritime transportsystemer
Research Scientist - Maritime Transport Systems

MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
Mobile:   +47 90 95 64 69 -  Phone: +47 464 15 000
Web:       www.marintek.sintef.no<http://www.marintek.sintef.no/>


Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I think that RestEasy supports that too, though.

cheers
Dan


On 19 May 2015 at 13:11, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

>  REST with XML :-)
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 19. mai 2015 09:07
> *To:* Marianne Hagaseth
> *Cc:* users@isis.apache.org
>
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> I'd move up a layer or two.
>
>
>
> I think you said it was an XML web service, in which case SOAP and WSDL?
>
>
>
> If so, I suggest Apache CXF [1] is a reasonable approach.
>
>
>
> If it is JSON and REST instead, then you could also use Apache CXF, I
> think, or alternatively look at JBoss Resteasy [2]
>
>
>
> HTH
>
> Dan
>
>
>
> [1] http://cxf.apache.org/docs/how-do-i-develop-a-client.html
>
> [2]
> https://docs.jboss.org/resteasy/docs/3.0-beta-3/userguide/html/RESTEasy_Client_Framework.html
>
>
>
>
>
>
>
>
>
> On 19 May 2015 at 07:29, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> Any idea of which one of these that goes best with ISIS?
>
>
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 18. mai 2015 11:19
> *To:* Marianne Hagaseth; users
>
>
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> // copying this back onto users@i.a.o for others...
>
>
>
>
>
>
>
> On 18 May 2015 at 08:22, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> Yes, that makes sense!
>
> Thank you!
>
> So, I will create a domain service that is a REST client, and then inject
> this into the view model.
>
> This will be similar to other domain services,
>
>
>
> yes, in that you just annotated it with
>
>
>
>     @DomainService(natureOfService=DOMAIN)     // so not visible in UI
>
>
>
>
>
>
>
>
>
>  or not (so I will find links on the Isis homepage)?
>
>
>
>
>
>
>
> there aren't any examples in Isis, but Johan's project on github makes a
> similar sort of REST call (albeit to a JSON REST); see [1]
>
>
>
>
>
> Cheers
>
> Dan
>
>
>
> [1]
> https://github.com/johandoornenbal/matching/tree/master/dom/src/main/java/org/isisaddons/services/postalcode
>
>
>
>
>
>
>
>
>
>  Best,
>
> Marianne.
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 18. mai 2015 08:44
> *To:* Marianne Hagaseth
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> Hi Marianne,
>
>
>
> yes, that makes sense, though from your description it doesn't sound like
> Isis' RO viewer has any role to play in your design.  Instead you should
> create a domain service that acts as the REST client to the external
> system, and have this domain service be injected into your Isis entity/view
> models.
>
>
>
> Here's a quick sketch of that design [1]
>
>
>
> Make sense?
>
>
>
> Cheers
>
> Dan
>
>
>
> [1] https://dl.dropboxusercontent.com/u/10536589/marianne-sketch.png
>
>
>
>
>
> On 18 May 2015 at 07:25, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> My task is (maybe) simpler: I I want to create a REST client in the ISIS
> (I have used the kitchen-sink example) (this client is fired when pressing
> a button in the wicket viewer GUI) and then use this to invoke a REST
> service outside ISIS that returns a XML, not a JSON, using HTTP.
> Does that make sense?
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Marianne Hagaseth
> Sent: 13. mai 2015 10:43
> To: dan@haywood-associates.co.uk
> Subject: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
> Thanks a lot!
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Sent: 13. mai 2015 10:40
> To: users
> Subject: Re: Setting up REST client ISIS 1.9.0: Guideline?
>
> Hi Marianne,
>
> I use a combination of Chrome's json-view plugin (to view, and following
> links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).
>
> These links from the archives [1], [2] might help.
>
> Regarding xsd, you could borrow some code from the todoapp [3]; the latest
> version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated
> classes frmo an XSD.
>
> HTH
> Dan
>
>
> [1]
>
> http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E
>
> [2] https://www.youtube.com/watch?v=_-TOvVYWCHc
>
> [3]
>
> https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36
>
>
> On 13 May 2015 at 09:33, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > A simple question:
> > Where can I find a guideline for how to set up a REST web client in
> > Apache ISIS?
> > I mean, just having a button which calls a REST web service using
> > simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
> >
> > And what is best to use to generate the class files from the xsd
> > fetched from the REST web service? Apache axis2?  cxf?
> >
> > Using Eclipse, ISIS 1.9.0, and wicket viewer.
> >
> > Best,
> > Marianne.
> >
> > Med vennlig hilsen / Best regards,
> > Marianne Hagaseth
> > Forsker - Maritime transportsystemer
> > Research Scientist - Maritime Transport Systems
> >
> > MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> > Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> > Mobile:   +47 90 95 64 69 -  Phone: +47 464 15 000
> > Web:       www.marintek.sintef.no<http://www.marintek.sintef.no/>
> >
> >
>
>
>
>
>
>
>

RE: FW: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Marianne Hagaseth <Ma...@marintek.sintef.no>.
REST with XML :-)

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
Sent: 19. mai 2015 09:07
To: Marianne Hagaseth
Cc: users@isis.apache.org
Subject: Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

I'd move up a layer or two.

I think you said it was an XML web service, in which case SOAP and WSDL?

If so, I suggest Apache CXF [1] is a reasonable approach.

If it is JSON and REST instead, then you could also use Apache CXF, I think, or alternatively look at JBoss Resteasy [2]

HTH
Dan

[1] http://cxf.apache.org/docs/how-do-i-develop-a-client.html
[2] https://docs.jboss.org/resteasy/docs/3.0-beta-3/userguide/html/RESTEasy_Client_Framework.html




On 19 May 2015 at 07:29, Marianne Hagaseth <Ma...@marintek.sintef.no>> wrote:
Any idea of which one of these that goes best with ISIS?

[cid:image001.png@01D0923D.AEECCFC0]

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

From: Dan Haywood [mailto:dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>]
Sent: 18. mai 2015 11:19
To: Marianne Hagaseth; users

Subject: Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

// copying this back onto users@i.a.o<ma...@i.a.o> for others...



On 18 May 2015 at 08:22, Marianne Hagaseth <Ma...@marintek.sintef.no>> wrote:
Yes, that makes sense!
Thank you!
So, I will create a domain service that is a REST client, and then inject this into the view model.
This will be similar to other domain services,

yes, in that you just annotated it with

    @DomainService(natureOfService=DOMAIN)     // so not visible in UI




or not (so I will find links on the Isis homepage)?



there aren't any examples in Isis, but Johan's project on github makes a similar sort of REST call (albeit to a JSON REST); see [1]


Cheers
Dan

[1] https://github.com/johandoornenbal/matching/tree/master/dom/src/main/java/org/isisaddons/services/postalcode




Best,
Marianne.

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

From: Dan Haywood [mailto:dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>]
Sent: 18. mai 2015 08:44
To: Marianne Hagaseth
Subject: Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

Hi Marianne,

yes, that makes sense, though from your description it doesn't sound like Isis' RO viewer has any role to play in your design.  Instead you should create a domain service that acts as the REST client to the external system, and have this domain service be injected into your Isis entity/view models.

Here's a quick sketch of that design [1]

Make sense?

Cheers
Dan

[1] https://dl.dropboxusercontent.com/u/10536589/marianne-sketch.png


On 18 May 2015 at 07:25, Marianne Hagaseth <Ma...@marintek.sintef.no>> wrote:
My task is (maybe) simpler: I I want to create a REST client in the ISIS (I have used the kitchen-sink example) (this client is fired when pressing a button in the wicket viewer GUI) and then use this to invoke a REST service outside ISIS that returns a XML, not a JSON, using HTTP.
Does that make sense?

Best,
Marianne.

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

-----Original Message-----
From: Marianne Hagaseth
Sent: 13. mai 2015 10:43
To: dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>
Subject: FW: Setting up REST client ISIS 1.9.0: Guideline?

Thanks a lot!

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>]
Sent: 13. mai 2015 10:40
To: users
Subject: Re: Setting up REST client ISIS 1.9.0: Guideline?
Hi Marianne,

I use a combination of Chrome's json-view plugin (to view, and following
links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).

These links from the archives [1], [2] might help.

Regarding xsd, you could borrow some code from the todoapp [3]; the latest version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated classes frmo an XSD.

HTH
Dan


[1]
http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E

[2] https://www.youtube.com/watch?v=_-TOvVYWCHc

[3]
https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36


On 13 May 2015 at 09:33, Marianne Hagaseth < Marianne.Hagaseth@marintek.sintef.no<ma...@marintek.sintef.no>> wrote:

> A simple question:
> Where can I find a guideline for how to set up a REST web client in
> Apache ISIS?
> I mean, just having a button which calls a REST web service using
> simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
>
> And what is best to use to generate the class files from the xsd
> fetched from the REST web service? Apache axis2?  cxf?
>
> Using Eclipse, ISIS 1.9.0, and wicket viewer.
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker - Maritime transportsystemer
> Research Scientist - Maritime Transport Systems
>
> MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> Mobile:   +47 90 95 64 69<tel:%2B47%2090%2095%2064%2069> -  Phone: +47 464 15 000<tel:%2B47%20464%2015%20000>
> Web:       www.marintek.sintef.no<http://www.marintek.sintef.no><http://www.marintek.sintef.no/>
>
>




Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I'd move up a layer or two.

I think you said it was an XML web service, in which case SOAP and WSDL?

If so, I suggest Apache CXF [1] is a reasonable approach.

If it is JSON and REST instead, then you could also use Apache CXF, I
think, or alternatively look at JBoss Resteasy [2]

HTH
Dan

[1] http://cxf.apache.org/docs/how-do-i-develop-a-client.html
[2]
https://docs.jboss.org/resteasy/docs/3.0-beta-3/userguide/html/RESTEasy_Client_Framework.html




On 19 May 2015 at 07:29, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

>  Any idea of which one of these that goes best with ISIS?
>
>
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 18. mai 2015 11:19
> *To:* Marianne Hagaseth; users
>
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> // copying this back onto users@i.a.o for others...
>
>
>
>
>
>
>
> On 18 May 2015 at 08:22, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> Yes, that makes sense!
>
> Thank you!
>
> So, I will create a domain service that is a REST client, and then inject
> this into the view model.
>
> This will be similar to other domain services,
>
>
>
> yes, in that you just annotated it with
>
>
>
>     @DomainService(natureOfService=DOMAIN)     // so not visible in UI
>
>
>
>
>
>
>
>
>
>  or not (so I will find links on the Isis homepage)?
>
>
>
>
>
>
>
> there aren't any examples in Isis, but Johan's project on github makes a
> similar sort of REST call (albeit to a JSON REST); see [1]
>
>
>
>
>
> Cheers
>
> Dan
>
>
>
> [1]
> https://github.com/johandoornenbal/matching/tree/master/dom/src/main/java/org/isisaddons/services/postalcode
>
>
>
>
>
>
>
>
>
>  Best,
>
> Marianne.
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 18. mai 2015 08:44
> *To:* Marianne Hagaseth
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> Hi Marianne,
>
>
>
> yes, that makes sense, though from your description it doesn't sound like
> Isis' RO viewer has any role to play in your design.  Instead you should
> create a domain service that acts as the REST client to the external
> system, and have this domain service be injected into your Isis entity/view
> models.
>
>
>
> Here's a quick sketch of that design [1]
>
>
>
> Make sense?
>
>
>
> Cheers
>
> Dan
>
>
>
> [1] https://dl.dropboxusercontent.com/u/10536589/marianne-sketch.png
>
>
>
>
>
> On 18 May 2015 at 07:25, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> My task is (maybe) simpler: I I want to create a REST client in the ISIS
> (I have used the kitchen-sink example) (this client is fired when pressing
> a button in the wicket viewer GUI) and then use this to invoke a REST
> service outside ISIS that returns a XML, not a JSON, using HTTP.
> Does that make sense?
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Marianne Hagaseth
> Sent: 13. mai 2015 10:43
> To: dan@haywood-associates.co.uk
> Subject: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
> Thanks a lot!
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Sent: 13. mai 2015 10:40
> To: users
> Subject: Re: Setting up REST client ISIS 1.9.0: Guideline?
>
> Hi Marianne,
>
> I use a combination of Chrome's json-view plugin (to view, and following
> links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).
>
> These links from the archives [1], [2] might help.
>
> Regarding xsd, you could borrow some code from the todoapp [3]; the latest
> version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated
> classes frmo an XSD.
>
> HTH
> Dan
>
>
> [1]
>
> http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E
>
> [2] https://www.youtube.com/watch?v=_-TOvVYWCHc
>
> [3]
>
> https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36
>
>
> On 13 May 2015 at 09:33, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > A simple question:
> > Where can I find a guideline for how to set up a REST web client in
> > Apache ISIS?
> > I mean, just having a button which calls a REST web service using
> > simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
> >
> > And what is best to use to generate the class files from the xsd
> > fetched from the REST web service? Apache axis2?  cxf?
> >
> > Using Eclipse, ISIS 1.9.0, and wicket viewer.
> >
> > Best,
> > Marianne.
> >
> > Med vennlig hilsen / Best regards,
> > Marianne Hagaseth
> > Forsker - Maritime transportsystemer
> > Research Scientist - Maritime Transport Systems
> >
> > MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> > Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> > Mobile:   +47 90 95 64 69 -  Phone: +47 464 15 000
> > Web:       www.marintek.sintef.no<http://www.marintek.sintef.no/>
> >
> >
>
>
>
>
>

RE: FW: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Marianne Hagaseth <Ma...@marintek.sintef.no>.
Any idea of which one of these that goes best with ISIS?

[cid:image001.png@01D091AC.1BB40750]

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
Sent: 18. mai 2015 11:19
To: Marianne Hagaseth; users
Subject: Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

// copying this back onto users@i.a.o<ma...@i.a.o> for others...



On 18 May 2015 at 08:22, Marianne Hagaseth <Ma...@marintek.sintef.no>> wrote:
Yes, that makes sense!
Thank you!
So, I will create a domain service that is a REST client, and then inject this into the view model.
This will be similar to other domain services,

yes, in that you just annotated it with

    @DomainService(natureOfService=DOMAIN)     // so not visible in UI




or not (so I will find links on the Isis homepage)?



there aren't any examples in Isis, but Johan's project on github makes a similar sort of REST call (albeit to a JSON REST); see [1]


Cheers
Dan

[1] https://github.com/johandoornenbal/matching/tree/master/dom/src/main/java/org/isisaddons/services/postalcode




Best,
Marianne.

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

From: Dan Haywood [mailto:dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>]
Sent: 18. mai 2015 08:44
To: Marianne Hagaseth
Subject: Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

Hi Marianne,

yes, that makes sense, though from your description it doesn't sound like Isis' RO viewer has any role to play in your design.  Instead you should create a domain service that acts as the REST client to the external system, and have this domain service be injected into your Isis entity/view models.

Here's a quick sketch of that design [1]

Make sense?

Cheers
Dan

[1] https://dl.dropboxusercontent.com/u/10536589/marianne-sketch.png


On 18 May 2015 at 07:25, Marianne Hagaseth <Ma...@marintek.sintef.no>> wrote:
My task is (maybe) simpler: I I want to create a REST client in the ISIS (I have used the kitchen-sink example) (this client is fired when pressing a button in the wicket viewer GUI) and then use this to invoke a REST service outside ISIS that returns a XML, not a JSON, using HTTP.
Does that make sense?

Best,
Marianne.

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

-----Original Message-----
From: Marianne Hagaseth
Sent: 13. mai 2015 10:43
To: dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>
Subject: FW: Setting up REST client ISIS 1.9.0: Guideline?

Thanks a lot!

Med vennlig hilsen / Best regards,
Marianne Hagaseth
Forsker – Maritime transportsystemer
Research Scientist – Maritime Transport Systems

-----Original Message-----
From: Dan Haywood [mailto:dan@haywood-associates.co.uk<ma...@haywood-associates.co.uk>]
Sent: 13. mai 2015 10:40
To: users
Subject: Re: Setting up REST client ISIS 1.9.0: Guideline?
Hi Marianne,

I use a combination of Chrome's json-view plugin (to view, and following
links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).

These links from the archives [1], [2] might help.

Regarding xsd, you could borrow some code from the todoapp [3]; the latest version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated classes frmo an XSD.

HTH
Dan


[1]
http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E

[2] https://www.youtube.com/watch?v=_-TOvVYWCHc

[3]
https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36


On 13 May 2015 at 09:33, Marianne Hagaseth < Marianne.Hagaseth@marintek.sintef.no<ma...@marintek.sintef.no>> wrote:

> A simple question:
> Where can I find a guideline for how to set up a REST web client in
> Apache ISIS?
> I mean, just having a button which calls a REST web service using
> simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
>
> And what is best to use to generate the class files from the xsd
> fetched from the REST web service? Apache axis2?  cxf?
>
> Using Eclipse, ISIS 1.9.0, and wicket viewer.
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker - Maritime transportsystemer
> Research Scientist - Maritime Transport Systems
>
> MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> Mobile:   +47 90 95 64 69<tel:%2B47%2090%2095%2064%2069> -  Phone: +47 464 15 000<tel:%2B47%20464%2015%20000>
> Web:       www.marintek.sintef.no<http://www.marintek.sintef.no><http://www.marintek.sintef.no/>
>
>



Re: FW: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
// copying this back onto users@i.a.o for others...



On 18 May 2015 at 08:22, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

>  Yes, that makes sense!
>
> Thank you!
>
> So, I will create a domain service that is a REST client, and then inject
> this into the view model.
>
> This will be similar to other domain services,
>

yes, in that you just annotated it with

    @DomainService(natureOfService=DOMAIN)     // so not visible in UI





> or not (so I will find links on the Isis homepage)?
>
>
>


there aren't any examples in Isis, but Johan's project on github makes a
similar sort of REST call (albeit to a JSON REST); see [1]


Cheers
Dan

[1]
https://github.com/johandoornenbal/matching/tree/master/dom/src/main/java/org/isisaddons/services/postalcode





>  Best,
>
> Marianne.
>
>
>
> Med vennlig hilsen / Best regards,
>
> *Marianne Hagaseth*
>
> Forsker – Maritime transportsystemer
>
> Research Scientist – Maritime Transport Systems
>
>
>
> *From:* Dan Haywood [mailto:dan@haywood-associates.co.uk]
> *Sent:* 18. mai 2015 08:44
> *To:* Marianne Hagaseth
> *Subject:* Re: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
>
>
> Hi Marianne,
>
>
>
> yes, that makes sense, though from your description it doesn't sound like
> Isis' RO viewer has any role to play in your design.  Instead you should
> create a domain service that acts as the REST client to the external
> system, and have this domain service be injected into your Isis entity/view
> models.
>
>
>
> Here's a quick sketch of that design [1]
>
>
>
> Make sense?
>
>
>
> Cheers
>
> Dan
>
>
>
> [1] https://dl.dropboxusercontent.com/u/10536589/marianne-sketch.png
>
>
>
>
>
> On 18 May 2015 at 07:25, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> My task is (maybe) simpler: I I want to create a REST client in the ISIS
> (I have used the kitchen-sink example) (this client is fired when pressing
> a button in the wicket viewer GUI) and then use this to invoke a REST
> service outside ISIS that returns a XML, not a JSON, using HTTP.
> Does that make sense?
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Marianne Hagaseth
> Sent: 13. mai 2015 10:43
> To: dan@haywood-associates.co.uk
> Subject: FW: Setting up REST client ISIS 1.9.0: Guideline?
>
> Thanks a lot!
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker – Maritime transportsystemer
> Research Scientist – Maritime Transport Systems
>
> -----Original Message-----
> From: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Sent: 13. mai 2015 10:40
> To: users
> Subject: Re: Setting up REST client ISIS 1.9.0: Guideline?
>
> Hi Marianne,
>
> I use a combination of Chrome's json-view plugin (to view, and following
> links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).
>
> These links from the archives [1], [2] might help.
>
> Regarding xsd, you could borrow some code from the todoapp [3]; the latest
> version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated
> classes frmo an XSD.
>
> HTH
> Dan
>
>
> [1]
>
> http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E
>
> [2] https://www.youtube.com/watch?v=_-TOvVYWCHc
>
> [3]
>
> https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36
>
>
> On 13 May 2015 at 09:33, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > A simple question:
> > Where can I find a guideline for how to set up a REST web client in
> > Apache ISIS?
> > I mean, just having a button which calls a REST web service using
> > simple HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
> >
> > And what is best to use to generate the class files from the xsd
> > fetched from the REST web service? Apache axis2?  cxf?
> >
> > Using Eclipse, ISIS 1.9.0, and wicket viewer.
> >
> > Best,
> > Marianne.
> >
> > Med vennlig hilsen / Best regards,
> > Marianne Hagaseth
> > Forsker - Maritime transportsystemer
> > Research Scientist - Maritime Transport Systems
> >
> > MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> > Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> > Mobile:   +47 90 95 64 69 -  Phone: +47 464 15 000
> > Web:       www.marintek.sintef.no<http://www.marintek.sintef.no/>
> >
> >
>
>
>

Re: Setting up REST client ISIS 1.9.0: Guideline?

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Marianne,

I use a combination of Chrome's json-view plugin (to view, and following
links) and Chrome Postman plugin (to submit GET/POST/PUT/DELETE).

These links from the archives [1], [2] might help.

Regarding xsd, you could borrow some code from the todoapp [3]; the latest
version uses the maven-jaxb2-plugin plugin to generate JAXB-annotated
classes frmo an XSD.

HTH
Dan


[1]
http://mail-archives.apache.org/mod_mbox/isis-users/201504.mbox/%3CCALJOYLEDs6ABT6SpAMNo8dA0V-RZjXYRSWFRCsoobpc6Gu3QVg@mail.gmail.com%3E

[2] https://www.youtube.com/watch?v=_-TOvVYWCHc

[3]
https://github.com/isisaddons/isis-app-todoapp/blob/master/canonical/pom.xml#L36


On 13 May 2015 at 09:33, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

> A simple question:
> Where can I find a guideline for how to set up a REST web client in Apache
> ISIS?
> I mean, just having a button which calls a REST web service using simple
> HTTP GET/POST/UPDATE/DELETE, and then displaying the result?
>
> And what is best to use to generate the class files from the xsd fetched
> from the REST web service? Apache axis2?  cxf?
>
> Using Eclipse, ISIS 1.9.0, and wicket viewer.
>
> Best,
> Marianne.
>
> Med vennlig hilsen / Best regards,
> Marianne Hagaseth
> Forsker - Maritime transportsystemer
> Research Scientist - Maritime Transport Systems
>
> MARINTEK (Norsk Marinteknisk Forskningsinstitutt AS)
> Address:  POB 4125 Valentinlyst, NO-7450 Trondheim, Norway
> Mobile:   +47 90 95 64 69 -  Phone: +47 464 15 000
> Web:       www.marintek.sintef.no<http://www.marintek.sintef.no/>
>
>