REST with XML :-) Med vennlig hilsen / Best regards, Marianne Hagaseth Forsker – Maritime transportsystemer Research Scientist – Maritime Transport Systems
From: Dan Haywood [mailto:[email protected]] Sent: 19. mai 2015 09:07 To: Marianne Hagaseth Cc: [email protected] 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 <[email protected]<mailto:[email protected]>> wrote: Any idea of which one of these that goes best with ISIS? [cid:[email protected]] Med vennlig hilsen / Best regards, Marianne Hagaseth Forsker – Maritime transportsystemer Research Scientist – Maritime Transport Systems From: Dan Haywood [mailto:[email protected]<mailto:[email protected]>] 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 [email protected]<mailto:[email protected]> for others... On 18 May 2015 at 08:22, Marianne Hagaseth <[email protected]<mailto:[email protected]>> 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:[email protected]<mailto:[email protected]>] 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 <[email protected]<mailto:[email protected]>> 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: [email protected]<mailto:[email protected]> 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:[email protected]<mailto:[email protected]>] 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-rzjxyrswfrcsoobpc6gu3...@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 < [email protected]<mailto:[email protected]>> 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/> > >
