ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Implementing a REST Interface : IIB9

Post new topic  Reply to topic
 Implementing a REST Interface : IIB9 « View previous topic :: View next topic » 
Author Message
akil
PostPosted: Wed May 28, 2014 10:39 am    Post subject: Implementing a REST Interface : IIB9 Reply with quote

Partisan

Joined: 27 May 2014
Posts: 338
Location: Mumbai

Hi

Is there a recommended or a built in way to implement a REST interface in IIB9 ? The intent is to expose conventional URI's such as

GET /classes
GET /students
GET /class/:id
GET /student/:id
PUT /class/new

and so on.. for the class and student entity.

The responses are easy to create with a mapping node (and a db:select) or a MQ exchange with the host system. I am wondering about how to process the requests ( parse URL's , calling appropriate mapping nodes or MQ sub flows ) ..
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed May 28, 2014 12:43 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Send the url with a query string on a post
Work off the xml...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
akil
PostPosted: Sat Jul 19, 2014 5:32 am    Post subject: Reply with quote

Partisan

Joined: 27 May 2014
Posts: 338
Location: Mumbai

Hi

I have been able to figure out how to use the QueryString and how to specify a model for the HTTP POST (in case it contains an XML).

I need advice on how to model the REST resource conventions. For example, i need to support a dynamic URL such as the following

Code:

/find_account/:type/:key.xml


Sample URI's

Code:

/find_account/RET/100011.xml
/find_account/CRP/100022.xml


As you can see, there is no QueryString, & I need to parse the RequestURI to get the value of :type & :key variables and then use them in by Mapping Node/ESQL.

Is there a way to model these in IIB9 (or the upcoming IIB10?) ? Or should I just go ahead and parse the URI?
_________________
Regards
Back to top
View user's profile Send private message Visit poster's website
smdavies99
PostPosted: Sat Jul 19, 2014 6:21 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you looked at the trace node output for

${Root}

and

${LocalEnvironment}

for your test messages? some of what you want may already be there.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
akil
PostPosted: Mon Jul 21, 2014 3:13 am    Post subject: Reply with quote

Partisan

Joined: 27 May 2014
Posts: 338
Location: Mumbai

Hi

Yes , the RequestURI contains the path which can be tokenised by splitting on the '/' separator.. but this code can quickly get complicated if I need to handle nested resources and id's ... I was looking for some pattern / available convention / code to do this .. Have started wiring it up myself for the moment, will share the code on github shortly , in case anyone needs it..
_________________
Regards
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Implementing a REST Interface : IIB9
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.