3

Currently, we are connecting getting information from web service through cobol by using "db2 xml" "SOAP HTTP NV".

Currently using sql mentioned below,

exec sql                                                             
              select                                                           
                db2xml.soaphttpnv
                (:internet protocol address,:webservice namespace,:soap xml schema
                  structure)                     
                  into :varchar-output                                           
              from sysibm.sysdummy1                                             
end-exec.  

I am pondering the possibilities on hitting the web service without intervention of db2.

I came accross z/os connect ee. I am looking forward to find out the components that would be required in z/os connect to ensure calling SOAP based webservice from cobol(without intervention of db2).

Any suggestions from stalwarts and experts who have achieved this would be much appreciated.

Many thanks in advance!

  • Just a point of reference, but SOAP isn't that hard to do by hand, depending on how complicated a service you're looking to call. Ultimately, it's just an HTTP transaction with a well-documented SOAP envelope added in...don't be afraid to do it brute force for the simpler cases. Here's an example in C: http://cs.pnw.edu/~rlkraft/cs404-2006/SOAP-client/SOAP-client.c – Valerie R Dec 06 '18 at 20:43

3 Answers3

2

You could also use IBMs z/OS HTTP/HTTPS Protocol Enabler to invoke services. We do this in batch programs and IMS transactions. Check https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ieac100/ieac1-client-web-enablement.htm for more information.

Fred
  • 31
  • 3
  • Does this make a SOAP based call to the webservice? Thanks! – NewGirlInSoftware Nov 29 '18 at 18:30
  • 1
    It 'does not make SOAP calls'; it is a library that a program can use to make http calls. So you could write programs that use the protocol enabler to invoke SOAP webservices. The programs must create the xml request but can then use the protocol enabler to send the request to the service and add the SOAP action header to that request. And they must process the XML response returned by the service. With the same approach you can also invoke JSON APIs. – Fred Dec 03 '18 at 06:19
  • Thanks. Just to make sure I follow correct, 1) Using z/OS connect EE and z/OS HTTP/HTTPS Protocol Enabler, can I invoke any public web service using SOAP? 2) In which language should we write programs that use the protocol enabler ? COBOL to JAVA(using class having the protocol enabler to invoke SOAP webservices) OR COBOL(using load module having the protocol enabler to invoke SOAP webservices). Many thanks in advance. – NewGirlInSoftware Dec 04 '18 at 22:32
  • 1
    If you use the z/OS HTTP/HTTPS Protocol Enabler you don't need z/OS Connect at all. The protocol enabler API can be called directly from COBOL (or PL/I or REXX or assembler) running as batch programs or IMS or CICS transactions. You don't need any additional products like z/OS Connect or additional glue-code in java or such. It is really straight forward and efficicent. – Fred Dec 06 '18 at 06:27
1

z/OS Connect EE only supports RESTful web services using JSON, not SOAP. You can do requests outbound using something called "API requester".

"Configuring z/OS Connect EE to support API requesters" in the IBM Knowledge Center gives details.

James
  • 331
  • 2
  • 9
0

We faced similar situation few years ago that we able to invoke the webservice from the CICS (SOAP request) but we don't have option for webservice from batch. So , we triggered the CICS program(EXCI) from batch with DFHS pipeline targeted CICS region where the data passed as parameter to DFHCOMMAREA/ separate table to have data if huge volume then with containers and channels generated xml and invoked the webservice (end points are already defined in the CICS region).