Author |
Message
|
Kishore p |
Posted: Fri Sep 02, 2016 6:30 am Post subject: Testing issue for REST API in IIB v 10.0.0.6 |
|
|
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 |
|
 |
exerk |
Posted: Fri Sep 02, 2016 6:39 am Post subject: |
|
|
 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 |
|
 |
Kishore p |
Posted: Fri Sep 02, 2016 6:45 am Post subject: |
|
|
Newbie
Joined: 23 Mar 2016 Posts: 5
|
Yeah..
It's newly added concept in IIB v10 |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 02, 2016 7:12 am Post subject: |
|
|
 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 |
|
 |
vishBroker |
Posted: Fri Sep 02, 2016 7:35 am Post subject: Re: Testing issue for REST API in IIB v 10.0.0.6 |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
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 |
|
 |
Vitor |
Posted: Fri Sep 02, 2016 7:41 am Post subject: Re: Testing issue for REST API in IIB v 10.0.0.6 |
|
|
 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 |
|
 |
stoney |
Posted: Fri Sep 02, 2016 9:29 am Post subject: |
|
|
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 |
|
 |
vishBroker |
Posted: Fri Sep 02, 2016 11:06 am Post subject: |
|
|
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.
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 |
|
 |
|