Page 1 of 1
Single standalone webpage on System i
Posted: Thu Oct 20, 2016 12:59 am
by HMJust
Hi again
I need to make a single webpage hosted on our System i. I have tried to get my head around the Webevent and have made a test that at least gets some sort of response - though it is mostly control codes.
As far as I have found out, I should be able to call it as for example http://DOMAIN:PORT/cgi-bin/lansaweb?procfun+PROCESS+FUNCTION+PARTION+LANGUAGE+FUNCPARMS+DUMMY(A0010):b and I get the strange response mentioned above.
The response will be consumed by a client service someone else is making, so I don't need any interaction or design - I basically just need to output some text.
I have some trouble figuring out the documentation and the samples, so is there anyone who can point me to a sample I could use?
Re: Single standalone webpage on System i
Posted: Thu Oct 20, 2016 8:28 am
by Stewart Marshall
When you say you "just need to output text", do you mean in the JSON/XML web service sense, or just a simple web page that displays a message to the user?
For the latter, a Webpage will solve the problem easily. It's a bit of a sledgehammer to crack a nut, but it will certainly do the job.
If you need to expose a webservice, you'll need to use Integrator.
Regards
Re: Single standalone webpage on System i
Posted: Thu Oct 20, 2016 4:49 pm
by HMJust
The response would probably be either XML or JSON, but the other service (out of my control) would prefer not to use SOAP.
Re: Single standalone webpage on System i
Posted: Thu Oct 20, 2016 4:57 pm
by MarkD
Speaking of SOAP reminded of this interesting 5 year old take on its status -
http://readwrite.com/2011/05/26/soap-is ... ts-undead/
Re: Single standalone webpage on System i
Posted: Thu Oct 20, 2016 11:15 pm
by HMJust
Yeah, well, my feelings towards SOAP aside, I have tried to work myself through the tutorial at
http://docs.lansa.com/14/en/lansa093/in ... _00500.htm and I must say that there are significant difference between the steps shown there and the UI in Lansa Integrator 14.0 on our development server.
Re: Single standalone webpage on System i
Posted: Thu Oct 20, 2016 11:54 pm
by HMJust
Granted, I got a bit confused there and see that the mismatch between the UI and the documentation isn't as big as I thought. And I am getting a response, so that's something.
Re: Single standalone webpage on System i
Posted: Fri Oct 21, 2016 9:29 am
by soa
If you want to call a LANSA WEB function that returns text (json, XML or plain text) the easiest and fastest way is to create a WAM WEbroutine with a Response type of *json or (#http). The routine will automatically map in posted variables via Web_map for(*input) and if *json is selected WEB_MAP for(*output) fields and lists will be automatically returned as LANSA json. If #http return is selected then any string built in the function or IFS file will be returned with full control over the content type. These functions are much faster than Integrator functions and much simpler to write and maintain.
Re: Single standalone webpage on System i
Posted: Fri Oct 21, 2016 5:49 pm
by HMJust
Thank you. I think you understood what I was trying to say - right now I am a bit committed on this task but I will look into that way later.