180 pts.
 Calling a URL length more than 200 from CLP
Hi Techies,

I would like to call a URL by passing some input values and retrieve some values from the results.

1. The URL lenght is more than 200, with special characters like % " < / >

2.I need to retrieve values from the particular website.

Can u please help me out soon, its been getting tougher more.

The URl looks like

http://...................../.........test.dll?API=Verify&XML=<AddressValidateRequest%20USERID="XXXXXXXX">..........<City>ENGLand</City><State>NJ</State>........</Zip4></Address></AddressValidateRequest>

I tried using a CLP using the command STRPCCMD using Batch file, i cant format the URL in it.

Or can u please suggest of what can be done? is that possible from RPG or any As400 commands, any solution is appreciated.

Please give me a solution.

Thanks in advance

As400Dev

 



Software/Hardware used:
As400
ASKED: January 28, 2010  12:31 PM
UPDATED: February 8, 2010  4:01 PM

Answer Wiki:
There is no "canned" command to do what you are describing. You could certainly create a command where the CPP (be it in CL or RPG) provides the application level function you generally describe. Bruce Vining <a href="http://www.brucevining.com/">Bruce Vining Services</a> ============================================ It's just a stab, but maybe you could build on this: what about a physical file with your URL or URL template. The file could be defined with one field, multiple fields, subdivided fields. In your CL DCLF FILE(/TESTURL) RCVF DEV(*FILE) /* READ A RECORD*/ Then refer to the field names as &variables to manipulate or use in cmds. ??? I don't get to work with URLs, so maybe I'm way off base.
Last Wiki Answer Submitted:  February 8, 2010  4:01 pm  by  Modiyooch   540 pts.
All Answer Wiki Contributors:  Modiyooch   540 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I would like to call a URL … and retrieve some values from the results.

In a CLP? Not very likely.

The URL lenght is more than 200, … using a CLP using the command STRPCCMD

STRPCCMD is limited to char(132) lengths for its commands, so STRPCCMD is out.

But since you’re handing it off as a PC command to be executed by a PC against some remote web server, how where you expecting any results from the web server to show up inside of your running CL program?

The only possibility I could imagine is if your CL opened its own socket to the HTTP server and posted the request directly and received the reply. That would take some pretty involved ILE CL coding at V5R4 or later, but it could probably be done.

I’d certainly want to do it in a HLL such as RPG before CL.

You might want to review Scott Klement’s HTTPAPI to see if it’s suitable.

Or perhaps some clarification of what you need done might help?

Tom

 107,735 pts.