View previous topic :: View next topic
|
Author |
Message |
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
I am trying to access a webpage from mainframe, Is there anyway to read HTML code from WWW.
I have used SAS HTTP access to do this in some LPARS, but we do not have SAS licensed in all the LPARS. Please let me know if there is any other way to do this.
I would consider myself lucky if the solution is using REXX.
Thanks for viewing, |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
If your site has the HTTP server set up, and the mainframe has access, it can be done. Find the IBM HTTP Server Bookshelf and read the HTTP Server: Planning, Installing, and Using manual -- especially Section 6 on Programming and section 6.1.10.2 on GCI REXX programming. You will be dealing with issues such as code page translation since the browswer is handling ASCII and the maifnrame is handling EBCDIC. It would be wise for you to consult with your site support group for assistance, especially since they may have changed the default port assignment. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello Robert,
Thanks for your thought & direction.. Before starting with the 754 page pdf I would like to clarify one doubt..
The target website is hosted by third party web server on web(in this case Yahoo) is HTTP server still required on the mainframe end to access third party website?
I was having a perception that HTTP access would be something like FTP access, but it does not seem so :S
Regards, |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
From my experience, HTTP access is nothing like FTP access.
I think I misunderstood what you want to do. It may be possible to do what you are asking but I've never heard of anyone doing so and have no idea how to accomplish it on a z/OS system. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Quote: |
I think I misunderstood what you want to do. |
I agree.. my first post was misleading/unclear from 3rd person point of view. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I have no idea, other than obviously you'd need to open a TCP/IP socket to the proper server and port. Establish the ASCII-to-EBCDIC translation. Beyond that, I don't know the details of the HTTP protocol, so how the flow of data is handled, I can't say. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Thanks for the link Peter, your answers have always been short and sharp :-)
now I will go away and do 2 things.. 1) patiently read the stuff on the PDF link & comprehend the things on it.. 2) buy drinks for a network support colleague.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Vasanth,
Quote: |
2) buy drinks for a network support colleague.. |
Bribery is often a good strategy . . .
Let us know how this proceeds.
d |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Dick,
my advice and getting drinks for it has nothing to do with bribery.
My payments for my service(s) are/were always payed with booze and gals. ICT is a wonderfull business if you dont care about money, but prefer the payment in nature. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
vasanthz,
here is an example in a Rexx i had to maintain sending TCP/IP data from
MF to PC :
/**********************************************************************/
/* Calling real 'SOCKET' */
/**********************************************************************/
socket: PROCEDURE EXPOSE src
a0 = Arg(1)
a1 = Arg(2)
a2 = Arg(3)
a3 = Arg(4)
a4 = Arg(5)
a5 = Arg(6)
a6 = Arg(7)
a7 = Arg(8)
a8 = Arg(9)
a9 = Arg(10)
PARSE VALUE 'SOCKET'(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9) WITH src res
Return res
Call Socket 'Initialize',subtaskid,pnv_maxdesc,pnv_svcname
If src = 0 Then sockinited = 1
Else Do
return_code = src
Call Unable_to_initialize_Socket
End |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
for examples on how to start REXX socket programming see Your communication server library
*****.SEZAINST ( probably the HLQ is TCPIP ) and meditate on the EZARX*** members!
for accessing an url and extract data a good idea could be to lurk into the PC REXX applications .
iirc there are a few examples around and the socket part is pretty the same!
see also this thread on IBM MAIN
www.mail-archive.com/ibm-main@bama.ua.edu/msg137979.html
and googling for rexx socket programming examples will return many useful links |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Peter,
Quote: |
My payments for my service(s) are/were always payed with booze and gals. |
I can always buy more booze and my bride has this thing about my payment being in physical consideration from other females. . .
Actually, it is usually i that fund drinking/dining excursions. Sometimes ya gotta get them (clients) in the right mood to say what is really on their mind.
d |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
Actually, it is usually i that fund drinking/dining excursions. Sometimes ya gotta get them (clients) in the right mood to say what is really on their mind.
|
Dick,
drinking/dining excursions here in Holland is still called "getting them laid",
or is it what B.D. said "Times They Are A Changing "? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
I got a code from the link Enrico provided, but there are some connectivity issue with that code at my site.. :S
Hopefully NET-ENG guys would resolve it soon.
Code: |
61 ECONNREFUSED Connection refused |
Here is the code, might be useful for someone else.
Code: |
/* rexx */
/* Make a connection to an http server, read the result and exit.
*/
Host = 'www.ibm.com'
Port = '80'
srv = Socket('Initialize', 'httpd')
srv= Socket('Socket')
parse var srv src sockid
srv = Socket('Ioctl',sockid,'FIONBIO','OFF' )
srv = Socket('Gethostbyname',Host)
parse var srv src hostip
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','SO_REUSEADDR','ON')
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','SO_LINGER','OFF')
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','TCP_NODELAY','OFF')
srv = Socket('Connect',sockid,'AF_INET' Port hostip)
parse var srv src .
If src > 0
then do
Say 'Unable to connect to' host':'port
Say 'Socket connect error:' srv
exit src
End
Exit 0 |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
firewall? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
I think so, I am not sure as I don't know anything about networks & the NET-ENG were using some terms used like NAT'ing, DNS, etc..
Also a issue of security was raised in allowing a client LPAR to access web.(which is a valid concern)
So to overcome this, we may fall back to using SAS in test LPAR and then FTP'ing the data. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Vasanthz,
i guess you didnt read the whole thread from enrico's link. There are some
pitfalls you can encounter. So i suggest to read the whole thread. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Peter,
Thanks for the share.
I could try it out as a proof of concept for understanding purposes, since by the look of way things are going at our shop, we maybe asked to fall back of SAS and a test LPAR + FTP cos of security concerns.
Regards, |
|
Back to top |
|
|
|