I have a COBOL program that needs to get data from a web service. Without using CICS what are my best options? I thought that a C program could read the web service and save it to a file, then the COBOL could read that file. Can COBOL call a web service? The data is about 300mb in size.
相关问题
- Is the Namespace for a SOAP Web Service case sensi
- How can I send parameters for ASP.NET webservice
- Http post request to a Django webservice (need log
- Sending Data to server using Jsoup Android
- WCF MessageContract wrapping and lists
相关文章
- Using JAX-WS 2.2.5 client with JDK/JRE 1.5
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- How to create base64Binary data?
- Are there any public UDDI registries available?
- REST search interface and the idempotency of GET
- Add Service Reference and Add Web Reference?
- Rest Web services returning a 404
- Protect Web API from unauthorized applications
Maybe have a look at this article. It suggests creating a C/C++ wrapper interace to the web service. Although this article is for iSeries, you might be able to implement something very similar under zSeries using BPXBATCH
Basically, they suggest using a C wrapper between your COBOL code and the C++ code that interfaces with the web service. This solution allows COBOL to call a C function in a relatively straight forward way. The C function mimics C++ behavior by implementing the call to the Web service using a C++ proxy.
If you can use Java at your site calling Java from a cobol program to access the web service may be an option. Assuming your using Enterprise cobol check out section 6.44 of Java Stand-alone Applications on z/OS Volume II
It is possible to call java from COBOL programs on z/os.
We have done it in our company.
Class HelloJ is
"com.ibm.zos.batch.container.test.HelloJ"
Class JavaException is "java.lang.Exception"
Class BCDTranHelper is
"com.ibm.batch.spi.UserControlledTransactionHelper".
***Then you can invoke java from COBOL in your PROCEDURE DIVISION with:
Invoke HelloJ "sayHello"
Also look at Java Exception Check * to see how to handle the exceptions.
This is very useful if you want to invoke a web service from your COBOL program on z/os.
see this link for more details.
http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.iean500%2Fcodeexm.htm
Use the IBM TCP/IP 'EZASOKET' modules
I work for a company with a z/OS system running mostly COBOL, batch (JCL) and CICS. To call webservices, we wrote a module to implement HTTP 1.0 using TCP/IP. With modules
supplementary modules:
Since I wrote this for my company, I can't just give out the code. But for reference, it took me 3 days to write the module, and that was with an example to start with that did a partial hacky way of doing it.
You'll need to read through IBM's references to know how to use the EZA modules.
Use the z/OS client web enablement toolkit if you are at z/OS 2.1 or above.
Look at the sample in SYS1.SAMPLIB(HWTHXCB1) for Cobol.
If your Cobol is running under DB2 DSN command, you can also use SOAPHTTP* scalar functions.