× 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.



I've always used my own stuff to read standard input and then assign
it to yajl using yajl_buf_load_tree(). You could try that, or try
debugging the YAJL procedures.

One tip, I would make a copy of YAJL for your use instead of using the
actual library. It will make updating a lot easier in the future. I
only say that since I notice you're setting the CGI library in your
config to YAJL. Just something I've gotten used to doing.

Here's a link to some code where I read standard input and assign it that way:
https://www.fieldexit.com/forum/display?threadid=351

Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #12: Both Text and HTML email support

On Mon, Jun 26, 2017 at 9:52 AM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
Posted this on HTTPAPI list but no takers so far. Hoping someone here can offer a suggestion or three.


I have been testing a JSON based web service with SoapUI and all was going well.

_But_ in order to make my code work initially I had had to use:

root = yajl_stdin_load_tree ( *Off: errMsg );

In other words I had to tell YAJL that my data was in EBCDIC. This didn't make sense to me because I thought I was sending UTF8 but I needed it working and thought that resolution could wait for another day. Got the whole service working beautifully.

But two things happened

1) "another day" has arrived and

2) A problem with SoapUI has meant my request configuration was not saved. Tried to set it up again and now I cannot get a single *%^$ thing working.


If I tell SoapUI that the data is "application/x-www-form-urlencoded" - which I am pretty certain is what it was set as - then I get a message back from YAJL saying "unsupported content-type [application/json; charset=utf-8]"

OK - data _is_ UTF8 so I changed the *Off in the load tree to *On. But now YAJL simply blows up during the tree load.

I have tried every combination of content setting and *On/*Off combination I can think of and nothing is working. Even if I get past the load tree blowing up then YAJL blows up subsequently when trying to locate the first node.

Although I did play with the Apache config (trying to fix the UTF8/EBCDIC issue) I'm certain it is now back where it was and, other than the noted *On/*Off changes mentioned above, the program has not been changed from the working version.

Apache config is straightforward as set by the wizard with changes only to the ScriptAlias - it looks like this:

1 # Configuration originally created by Create HTTP Server wizard on Mon Jan 23 16:49:35 EST 2012
2 Listen *:1241
3 DocumentRoot /www/jonrest/htdocs
4 TraceEnable Off
5 Options +ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -Indexes -MultiViews
6 LogFormat "%h %T %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
7 LogFormat "%{Cookie}n \"%r\" %t" cookie
8 LogFormat "%{User-agent}i" agent
9 LogFormat "%{Referer}i -> %U" referer
10 LogFormat "%h %l %u %t \"%r\" %>s %b" common
11 CustomLog logs/access_log combined
12 LogMaint logs/access_log 7 0
13 LogMaint logs/error_log 7 0
14 SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
15 SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
16 SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
17 SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
18 SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive
19 SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
20 MaxCGIJobs 3
21 MaxThreadedCGIJobs 3
22
23 ScriptAlias /SinglePartRequest /qsys.lib/xxxxxx.lib/Singlepart.pgm
24 <Directory /qsys.lib/xxxxxx.lib >
25 Order Allow,Deny
26 Allow From All
27 SetEnv QIBM_CGI_LIBRARY_LIST "YAJL"
28 </Directory>
29
30 <Directory />
31 Order Deny,Allow
32 Deny From all
33 </Directory>
34 <Directory /www/jonrest/htdocs>
35 Order Allow,Deny
36 Allow From all
37 </Directory>
38

Hopefully someone with more experience in this area can point me in the right direction because right now I'm clueless.


Jon Paris

www.partner400.com <http://www.partner400.com/>
www.SystemiDeveloper.com


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.