× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Bill,
Here's an example of using GETURI.

This example returns the result to the program, but it can also be saved to
a stream file with only a couple extra simple parameters.

Both the variable and the stream file are easily plugged into YAJL in order
to parse the results.

http://www.fieldexit.com/forum/display?threadid=43

Brad
www.bvstools.com

On Tue, Apr 12, 2016 at 7:28 PM, Bradley Stone <bvstone@xxxxxxxxx> wrote:

Bill,

This should be as simple as using our GETURI (www.bvstools.com/geturi.html)
tool or Scotts HTTPAPI to make the web request and save the JSON to a
file. Then you simply parse the JSON.

GETURI allows you to set headings to any values you want, even add your
own custom headings if need be. I'm sure HTTPAPI does as well.

I have a few tutorials on parsing JSON here:
http://www.fieldexit.com/forum/thread?groupid=Prog&forumid=POC

The part 1 article uses a stream file containing the JSON and parses it.

If your provide some info on the request I can show you a GETURI example,
and I'm sure others can help with an HTTPAPI sample.

Since you save you've done XML, there's really nothing different here
except a couple headers to set and using Scott's port of YAJL to parse.

Brad
www.bvstools.com


On Tue, Apr 12, 2016 at 4:50 PM, Bill Freiberg <
bill.freiberg@xxxxxxxxxxxxxx> wrote:

I need to have an RPG program invoke a remote web service and that web
service uses JSON for its request and response. This requires a post
request, and I need to set the Accept: application/json and Content-Type:
application/json header attributesin the header, then send the json in the
body. I have used YAJL to construct the JSON correctly. My problem is that
all examples I can find show how to “BE” the web service, not how to
“CONSUME” a web service with JSON. I have previously invoke remote RESTful
web services that use XML via Scot Klement’s LIBHTTP utilites. The JSON
piece and header/body have me spinning in circles. Does anybody have an
samples they know of that show how to consume a web service that uses JSON
for the request and response?








Bill Freiberg
Applications Development Manager
[Description: Description: ims_smlogo]
Integrated Merchandising Systems, LLC
8338 Austin Avenue
Morton Grove, IL 60053
(847) 583-3821 Work
(630) 240-1584 Cell


This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. Dissemination, distribution or copying
of this email or the information herein by anyone other than the intended
recipient, or an employee or agent responsible for delivering the message
to the intended recipient, is prohibited.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.