ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Accessing Transport API's

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing Transport API's

    Hi,

    I am writing a RESTful client utilizing IBM's IWS facility.

    The client is supposed to execute Transport C API's (axiscTransportCreate(), axiscTranportSetProperty(), etc.)

    Compiler errors out with a bunch of CPD5D02's (e.g., Definition not found for symbol 'axiscTransportCreate', etc.)

    The prototypes are defined in /QIBM/ProdData/OS/WebServices/V1/client/include/Axis.rpgleinc, and the source code includes the reference to the prototypes.

    I recall that in order to incorporate other C functions in an RPG program, binding directory QC2LE should be included. Apparently, not the case here.

    Any ideas?


  • #2
    Usually, you use the wsdl2rpg.sh or wsdl2ws.sh script to generate a web service stub, and this script takes care of binding to the proper service program. So, I don't think IBM provides a binding directory for the AXIS routines because they don't really expect you to call them outside of their stub.

    However, with a little poking around, I noticed that there are a bunch of service programs that seem to have the axis functions in them. Take a look at QSYSDIR/QAXIS10*. Specifically, the axiscTransportCreate() routine appears to be in the QAXIS10CC service program.

    QC2LE is for the standard C runtime library -- i.e. the functions that are always expected to be in any implementation the C language. The AXIS web service tools are not normally distributed with the C language, they are a separate add on, so it makes sense that they are not found in QC2LE.

    Comment


    • #3
      Hi Scott,

      Unless I am mistaken, wsdl2ws.sh is applicable to SOAP. In my case, there is no WSDL. In fact, I am consuming a RESTful service, no WSDL, that I''ve written myself.

      Following your suggestion, I bound service program QSYSDIR/QAXIS10CC to my client program, and it compiled! Now it will be interesting to see if it's actually going to work. Keep you posted...

      Comment


      • #4
        Yes, the RESTful IWS client is working. Although I must say, it seems to run substantially slower than HTTPAPI client. Perhaps, some benchmarking will be in order too.

        Comment


        • #5
          There was an interesting articla about the Transport APIs at Developer Works
          The integrated web services client for Integrated Language Environment (ILE) has been used for years to send SOAP messages by generating stubs that hide the details about the SOAP messaging protocol. However, it did not allow users to send user-defined payloads over the Hypertext Transfer Protocol (HTTP) transport. This article discusses the enhancements in the integrated web services client that allow you to bypass the stubs and send user-defined requests.

          Comment


          • #6
            Thanks Birgitta. Actually, I posted same question in that forum, and the author of the article came back with the same suggestion as Scott. Bind service program QSYSDIR/QAXIS10CC.

            Comment


            • #7
              Hi, guys. I found this conversation today. I am looking for a sample program that uses Axisc to communicate with a SOAP web service (XML). Any links you might have will be greatly appreciated.

              Comment


              • #8
                Just use the wsdl2rpg.sh or wsdl2ws.sh script to generate the code that calls the axisc routines for SOAP.

                Comment


                • RankynV
                  RankynV commented
                  Editing a comment
                  Thank you, Scott. On a separate note, do you know if yajl can be used to create the XML to pass to a SOAP service?

                • Scott Klement
                  Scott Klement commented
                  Editing a comment
                  YAJL does not know anything about XML.

                • RankynV
                  RankynV commented
                  Editing a comment
                  Hi, Scott. How does this wsdl2rpg.sh work? I am writing a program to send invoices to a third-party's SOAP web service, and I need to use Axis. My biggest issue right now is how to format the data for the 'request' piece of the axiscTransportSend() procedure. Do you have any links for a sample program or even documentation on how to format the data for the TransportSend() procedure?

              • #9
                There's source in QOAR/SAMPLE2 for a sample XML generator for DATA-GEN if you get the PTFs for DATA-GEN (7.3 or 7.4).

                Comment

                Working...
                X