Page 1 of 1

Web API on IBMi - how to call?

Posted: Tue Jul 26, 2022 11:07 pm
by Joerg Hamacher
Hello,

now that I have successfully sted my Web API on my local machine, I have checked everything in to the IBMi. This is the platform where the API has to run.

Unfortunately, I am now unable to access the object via Postman. The response is every time I try:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>404 Nicht gefunden</TITLE>
</HEAD>
<BODY>
<H1>Nicht gefunden</H1>
<p>The requested URL was not found on this server.</p>
</body>
</html>


In the Visual LANSA options the Web Page Base URL is set to http://MyIBMi:8875/l15pgmlib/, this access for Web Pages works fine.

When I check in the server module, an object is created in the IBMi program library SMH_V60P15. The server module in VL is called WH02, the object in the library SMH_V60P15 gets the name §WH02 during check-in. Partition name is V60.

In the httpd.conf for my IBMi HTTP Server L15PGMLIB I added the following:
Alias /smh /QSYS.LIB/SMH_V60P15.LIB

Operation path is /Preis.

So i tried things like:
http://MyIBMi:8875/smh/v60/wh02/preis
http://MyIBMi:8875/smh/wh02/preis
http://MyIBMi:8875/smh/v60/§wh02/preis
http://MyIBMi:8875/smh/§wh02/preis
http://MyIBMi:8875/l15pgmlib/v60/WH02/Preis
http://MyIBMi:8875/l15pgmlib/WH02/Preis


Nothing works.
What error in thinking am I making here? What is the correct configuration for the call? What is the correct setup in this case?

Thank you in advance and best regards.
Jörg

Re: Web API on IBMi - how to call?

Posted: Wed Jul 27, 2022 12:01 am
by Dino
It is my understanding that a little piece is missing an in the works for the IBM, in the meantime, this is the workaround:

viewtopic.php?f=3&t=2356

Basically using a windows IIS as a proxy, with a listener entry that points to the IBM.

Re: Web API on IBMi - how to call?

Posted: Wed Jul 27, 2022 12:33 am
by Joerg Hamacher
Hello Dino,

this is unfortunately not good news, that there is obviously still nothing working on the IBMi...
Our customer doesn't want to have an additional Windows server in between.

But we have already programmed years ago about LANSA Integrator and HTTPInbound and HTTPOutbund services on the IBMi and so realized the communication between various systems. The IBMi was also accessed from outside via URL. Is there a different system behind it than with the Web APIs?

And we also managed to access JSON APIs from IBMi that are located on external servers without using an additional server. Out of IBMi works - but not in the other direction?

Would it be possible to use LANSA Integrator's JSONBindFileService to create Web APIs for the IBMi that can be accessed from outside - or would that not work either?

Best regards,
Jörg

Re: Web API on IBMi - how to call?

Posted: Wed Jul 27, 2022 12:59 am
by Dino
I wonder myself what is the missing link...

what you define in the API tab regarding paths are registered in the file \LANSA\run\conf\webmodules.conf
which seems to be what is needed by the apache server to find the route to what server module to call.

maybe something related to the exchange of the data back and forth... operations, schemas.

Re: Web API on IBMi - how to call?

Posted: Thu Jul 28, 2022 5:57 pm
by Joerg Hamacher
Hello,

I have just learned that this functionality shall be delivered with EPC150060. This EPC is expected to be made available sometime in autumn (October).
That would of course be a good thing!

Kind regards,
Jörg