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 » Testing issue for REST API in IIB v 10.0.0.6

Post new topic  Reply to topic
 Testing issue for REST API in IIB v 10.0.0.6 « View previous topic :: View next topic » 
Author Message
Kishore p
PostPosted: Fri Sep 02, 2016 6:30 am    Post subject: Testing issue for REST API in IIB v 10.0.0.6 Reply with quote

Newbie

Joined: 23 Mar 2016
Posts: 5

Hi ,

I have created REST API using swagger document. I have used GET method that will take Employee ID as in parameter and results Employee details like Ename, Esal and Edepartment. This operation was implemented using Mapping node.

The problem here is that, when I tried to test the REST API by using Swagger UI tool (i.e, In swagger ui I suppose to paste the url of GET method which is available at Web user Interface of TEST NODE) I am getting following comments from Swagger UI

Can't read from server. It may not have the appropriate access-control-origin settings.

And also I tried to send the parameters through URL , Example:

http://localhost:7800/rest_api_employee/v1/getEmployeeID/2789

Then I am getting response as Invalid GET method.

Please help to resolve this issue.

Thanks in advance.
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Sep 02, 2016 6:39 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Kishore p, please take more care to post in the forum appropriate to your question, thank you. I have moved this to the IIB/Broker forum.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Kishore p
PostPosted: Fri Sep 02, 2016 6:45 am    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2016
Posts: 5

Yeah..
It's newly added concept in IIB v10
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Sep 02, 2016 7:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Kishore p wrote:
Yeah..
It's newly added concept in IIB v10


a) We know
b) So why didn't you post it in the IIB section in the first place then?

Are both the URL & method showing as registered?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vishBroker
PostPosted: Fri Sep 02, 2016 7:35 am    Post subject: Re: Testing issue for REST API in IIB v 10.0.0.6 Reply with quote

Centurion

Joined: 08 Dec 2010
Posts: 135

Kishore p wrote:
Hi ,


And also I tried to send the parameters through URL , Example:

http://localhost:7800/rest_api_employee/v1/getEmployeeID/2789

Then I am getting response as Invalid GET method.

Please help to resolve this issue.

Thanks in advance.


This is NOT the right way of sending query params.
IIB will treat it as a URI not as query params.
Use question mark (?) - try http://host:port/URLSuffix/methodName?2789


If you are able to make a call from browser..you should be able to make a call from SOAP UI.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Sep 02, 2016 7:41 am    Post subject: Re: Testing issue for REST API in IIB v 10.0.0.6 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vishBroker wrote:
This is NOT the right way of sending query params.


Oooo.....good catch!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
stoney
PostPosted: Fri Sep 02, 2016 9:29 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2013
Posts: 140

Quote:
Can't read from server. It may not have the appropriate access-control-origin settings.

This is because of something called CORS (or Cross-Origin Resource Sharing).
Because Swagger UI is hosted on a different host to the IIB REST API, Swagger UI must make a cross domain request.
Cross domain requests require support at the server side, so you need to enable CORS in IIB - for the integration server HTTP listener the magic command is:

Code:
mqsichangeproperties IB10NODE -e default -o HTTPConnector -n corsEnabled -v true


Quote:
This is NOT the right way of sending query params.


Where does the OP say that he defined the parameter as a query parameter, as opposed to a path parameter (or a header parameter)?
Back to top
View user's profile Send private message
vishBroker
PostPosted: Fri Sep 02, 2016 11:06 am    Post subject: Reply with quote

Centurion

Joined: 08 Dec 2010
Posts: 135

stoney wrote:

...

Code:
mqsichangeproperties IB10NODE -e default -o HTTPConnector -n corsEnabled -v true





stoney wrote:

...

Quote:
This is NOT the right way of sending query params.


Where does the OP say that he defined the parameter as a query parameter, as opposed to a path parameter (or a header parameter)?



OP says - he gets INVALID method name.

Kishore p wrote:

...
And also I tried to send the parameters through URL , Example:

http://localhost:7800/rest_api_employee/v1/getEmployeeID/2789

Then I am getting response as Invalid GET method.
...

This tells me - the RESTAPI application in IIB - which internally uses HTTP input node and route to label node - is NOT able to find the incoming label (method).
He says,,he wanted to send the paramter in the URL - and hence the assumption that he wanted to send query params.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Testing issue for REST API in IIB v 10.0.0.6
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.