Sponsored Links
Sponsored Link

sponsored links

Collapse

Announcement

Collapse
No announcement yet.

PHP call to RPG to return JSON

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP call to RPG to return JSON

    Not even sure if this makes sense, but a co-worker is working with the Zend Server and making an RPG call from his PHP script. The RPG progam uses YAJL and is hoping to grab the JSON from that standard output. So far no luck. Is this possible? Does it make sense?

    I call my YAJL/RPG programs directly from my ExtJS Ajax.Request, so it doesn't make sense to me.

    Thanks in advance.
    Your friends list is empty!

  • #2
    If you're calling the RPG in a way that stdout would be connected to your PHP script, then it makes perfect sense.

    If you're not, then it does not make sense.

    This doesn't seem to have anything to do with YAJL or JSON... but, its as simple as you can't use a communication channel that isn't connected.

    Comment


    • #3
      Thanks Scott.

      "If you're calling the RPG in a way that stdout would be connected to your PHP script, then it makes perfect sense."

      I'm not familiar with PHP at all. Is there a way to accomplish the above?
      Your friends list is empty!

      Comment


      • #4
        Calling it as a web service would work, opening a pipe to a new process on the box that in turn calls RPG would work... I expect there are more ways?

        I'm not really a PHP guy, either. I'm not the best person to enumerate all of the ways of calling things from PHP and telling you which will/won't work.

        Ultimately, it boils down to using whatever data passing mechanism is appropriate for your chosen way of calling the RPG. If you are manually opening a pipe to it, then use that pipe to send the data. If you're calling a web service, use the mechanism the web service tool provides for returning data. If you're calling via SQL, use a result set or parameter. If you're calling via something like XMLSERVICE, use the mechanism it provides (which I think is just parameters).

        Comment


        • #5
          I'm not clear on what you are trying to do. If you are wanting to pass JSON string (of unknown size) to RPG and parse it with RPG YAJL then another option is store the JSON on the IFS and use YAJL DATA-INTO.

          Ringer
          Suppose your boss tasks you with grabbing and processing some XML from an HTTP request to create a new customer order. If you have a “deer in the headlights” expression on your face, don’t fear, you don’t have to punt this request over the cubicle wall to the web developers. Without weeks or months of

          Comment


          • #6
            DATA-INTO is not limited to files in the IFS, it can also JSON from a string in the program.

            Comment

            sponsored links

            Collapse

            Working...
            X