Gen EDGE

 View Only
Expand all | Collapse all

How to receive a BLOB data from web service to action block?

  • 1.  How to receive a BLOB data from web service to action block?

    Posted Jul 01, 2016 07:00 AM

    Hi,

     

    I am facing run time error at call external statement while receiving the blob data type from web service. I have chosen default matching so coolgen created 2 GB blob work set view in export view. When I don't match anything to export, the program goes fine. From this I came to know receiving export view matching between action block and web service was the problem.

     

    I unmatched the default export view match and manually matched to a blob 2 MB work view. But the error remain still.

     

    Can you suggest me how to handle blob data type in call external statement. thanks.

     

    Error Log:-

    TIRM030E: Application failed - Updates have been backed out

    TIRM031E: Failing procedure exit data follows:

    TIRM032E: Last or current action block id    = 0022020097

    TIRM033E: Last or current action block name  = CAB_TO_CALL_WEB_SERVICE

    TIRM034E: Last or current database statement = 0

    TIRM035E: Current statement being processed  = 0000000001

    TIRM037E: ** Fatal Error was encountered ***

    TIRM149E: Error occurred in CA Gen supplied function: TIRXMGLB

    TIRM305E:

    TIRM046E: *** Processing terminated ***

    TIRM044E: *** Press OK to continue ***



  • 2.  Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Jul 04, 2016 12:02 AM
      |   view attached

    Hello,

    I tried to recreate your problem using this free public web service wsdl: http://api.thumbnail.ws/soap?wsdl

    (Free account to get apikey:       thumbnail.ws - Website thumbnails API!)

    However I did not encounter any error

     

    In this case for Default Matching Gen created a TEXT attribute because the wsdl is returning xsd data type of string, but I changed it to a 2GB BLOB for testing. See attached test model.

    Recommended Gen Data Type Choices for XSD Data Types - CA Gen - 8.5 - CA Technologies Documentation

    Maybe your problem is specific to the web service returning BLOB xsd data type base64binary or hexBinary? Which one is being returned?

    Thanks

    Lynn

    Attachment(s)

    zip
    blobtest.ief.zip   94 KB 1 version


  • 3.  Re: How to receive a BLOB data from web service to action block?

    Posted Jul 04, 2016 05:15 AM

    Hi Lynn,

     

    The web service returns base64binary data (PDF file is getting transferred as binary). I have given below the export mapping and binary attribute properties.

     

     

     

    Given below the import mapping.

     

     

    Thanks.



  • 4.  Re: How to receive a BLOB data from web service to action block?

    Posted Jul 04, 2016 07:15 AM

    from CA gen book - can you suggest me what the value meant here?

     



  • 5.  Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Jul 04, 2016 06:19 PM

    TIRXMGLB is the API function to populate a Gen BLOB attribute from the web service data map

    From the TIRM305E error it looks to me as if perhaps it is not finding the expected data from your web service?

    Maybe delete & re-add the CALL EXTERNAL statement in case the web service mapping is not correct.



  • 6.  Re: How to receive a BLOB data from web service to action block?

    Posted Jul 08, 2016 08:39 AM

    Hi,

     

    I have deleted and recoded the call external statement with both import and export view matched. This time I got different TIR function message as shown below.

     

    TIRM030E: Application failed - Updates have been backed out

    TIRM031E: Failing procedure exit data follows:

    TIRM032E: Last or current action block id    = 0022020097

    TIRM033E: Last or current action block name  = CAB_TO_CALL_WEB_SERVICE

    TIRM034E: Last or current database statement = 0

    TIRM035E: Current statement being processed  = 0000000001

    TIRM037E: ** Fatal Error was encountered ***

    TIRM149E: Error occurred in CA Gen supplied function: TIRXMGTX

    TIRM305E:

    TIRM046E: *** Processing terminated ***

    TIRM044E: *** Press OK to continue ***



  • 7.  Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Jul 12, 2016 06:22 PM

    Similar to the API function TIRXMGLB for BLOB, TIRXMGTX is the corresponding function to populate a Gen Text attribute from the web service data map. Therefore it looks like something is wrong with that mapping, so can you please recheck it. You could execute the code with trace (DTU) to see if it helps you diagnose a problem with the data.

    Is this a public web service we can test ourselves or internal to your company?

    Thanks

    Lynn



  • 8.  Re: How to receive a BLOB data from web service to action block?

    Posted Jul 15, 2016 05:47 AM

    Hi,

     

    It is internal to company. Hence, I could not share. in DTC, I could see the values propagate till call external. After call external, no data being returned except error.

     

    However the core java program can invoke that web service from same machine and retrieve the binary values (file) successfully.

     

    Thanks

    Vijayakumar



  • 9.  Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Jul 18, 2016 03:02 AM

    Hi Vijayakumar,

    As you have a support case 00452266 open I have emailed you to request data from that case & we will troubleshoot this problem there.

     

    Thanks

     

    Lynn

    00452266



  • 10.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 15, 2021 01:51 AM
    hi Lynn,

    I have an identical problem to that reported above.  Getting the following error on return from a web service (which returns a binary image):

    TIRM030E: Application failed - Updates have been backed out
    TIRM031E: Failing procedure exit data follows:
    TIRM032E: Last or current action block id    = 0022020120
    TIRM033E: Last or current action block name  = EAB_PREVIEW_OMEGA_BIN
    TIRM034E: Last or current database statement = 0
    TIRM035E: Current statement being processed  = 0000000001
    TIRM037E: ** Fatal Error was encountered ***
    TIRM149E: Error occurred in CA Gen supplied function: TIRXMGLB
    TIRM305E: Error could not locate value trying to perform external call
    TIRM046E: *** Processing terminated ***
    TIRM044E: *** Press OK to continue ***


    I've tried remapping views, using defaults, etc.  Nothing.

    Any help appreciated !​


  • 11.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 15, 2021 02:22 AM

    Hi @Jonathan Hardy,
    I notice your error refers to an EAB/External Action Block. So you are not using the Gen CALL EXTERNAL statement and are just calling a web service from your EAB from which you are passing back BLOB data to the caller CAB/PStep which is when the error occurs?

    Anyway, the solution to the previous user's problem was that the BLOB was in (PDF) file format.
    BLOB data needs to be in binary format to work with CA Gen 8.5 or 8.6. The below information can be found under the topic "BLOBs" within the CA Gen 8.5 Release Notes BLOBS section:
    +++
    BLOBs
    With CA Gen Release 8.5, the second phase of BLOB support provides the ability to store BLOBs in a database, fetch BLOBs from a database, and to include BLOBs in views so that they can be passed around in the generated application (including external action blocks). This functionality does not include presenting or collecting BLOB data at the user interface, the file system interface, or any other system interface.
    +++

    You say you have a binary image so the above may not be relevant for you. In that case
    please open a support ticket so we can research your problem in more detail.
    Thanks
     
    Lynn

    ​​



    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 12.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 15, 2021 05:13 PM
    hi Lynn,

    EAB_PREVIEW_OMEGA_BIN is not a true 'external', but an action block with a single statement that invokes the CALL WEBSERVICE

    1 +- EAB_PREVIEW_OMEGA_BIN
    2 | IMPORTS:
    3 | Work View in ws_blob (mandatory,transient,import only)
    4 | generic_2mb (mandatory)
    5 | EXPORTS:
    6 | Work View out ws_retrievedocumentresult (transient,export only)
    7 | image
    8 | LOCALS:
    9 | ENTITY ACTIONS:
    10 |
    11 | CALL EXTERNAL Web Service "cubaPrevLetterBinary"

    - in and out views are both defined as BLOB 2MB. 
    - In view has b64 content (ie, binary encoded as string); output is expected to be binary pdf.
    - after call to this AB, the output BLOB is written directly to a file, which is then opened in a pdf viewer.  

    curiously, we have a similar AB (EAB_VIEW_OMEGA_BIN) which actually works - ie, it produces valid pdf data which we are able to save and view.  The only difference I can see is that EAB_VIEW_OMEGA_BIN has input var text (not BLOB)



  • 13.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 15, 2021 05:50 PM
    update - managed to get it working.

    I'll post my analysis later today ...


  • 14.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 15, 2021 06:37 PM
    had to downsize output message size from 4mb to 2mb. 

    also, noticed that the intrinsic concat blob function was not available from my toolset.  Was able to get it working eventually, but prior to this had to use some inline as a work-around :


    // append blob to blob
    int rc = 0;
    TIRLOB_HANDLE* srclob = &##IN_SRC.WS_BLOB.GENERIC_2MB##;
    TIRLOB_HANDLE* dstlob = &##OUT_DEST.WS_BLOB.GENERIC_2MB##;

    rc = TIRLBAP(
      dstlob,
      2097152,
      srclob);

    ##OUT_RC.CSA_GENERIC_WORK_SET.GENERIC_NUMERIC_11## = rc;



    and ... as an aside, is there a way to override the error handling (eg user exit) so that I can manage exceptions more gracefully ?   I feel that this feature (calling external web service) is volatile, and subject to a number of points of failure end-to-end.  We really don't want an abend in a production environment - i'd rather pop up a message like 'contact system support' or similar ...


  • 15.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 15, 2021 07:03 PM
    Hi Jonathan Hardy,

    Call External statement does not handle any exceptions by its own. For exceptions at runtime, the application fails and sends error information.
    Below article describes how to handle exceptions in the Action diagram

    https://techdocs.broadcom.com/us/en/ca-mainframe-software/devops/ca-gen/8-6/developing/designing/using-the-toolset/working-with-toolset/use-action-diagram/assignment-action-statements/add-a-call-external-statement/error-handling-in-call-external.html

    if you still need user exit, please raise it as an idea.

    Regards,
    Amit


  • 16.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 15, 2021 07:46 PM

    @Jonathan Hardy
    Thanks for providing your resolution details. So it seems the root cause was that your views were defined for a 2MB BLOB but the actual size of 4MB was exceeding that?



    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 17.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 18, 2021 06:32 PM

    hi Lynn,

    When I get a chance I'll revert back to 4MB and see if the problem manifests itself again.  

    I suspect however it was the fact that I deleted the views -  and then remapped fresh views - that cleared the issue ...

    Out of interest, is there a way to get a pointer to the underlying BLOB data ?




  • 18.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 18, 2021 06:34 PM
    and thanks for the info about exception handling.  This will enable me to provide a much more robust solution


  • 19.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 19, 2021 07:12 AM
    one final question (hopfully) ... when will BLOBs be supported on the MVS platform ?

    I'm getting the following build error:

    ABG generating Encyid: 1357347352
    os MVS
    lang COBOL
    dbms DB2 z/OS
    compiler VSCOB
    tpmon CICS
    MBCS set code page ID: 1252.
    Starting Action Block Generator
    BLOB attributes are not supported by the targeting platform / language: MVS/COBOL



  • 20.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 19, 2021 12:06 PM
    Hi Jonathan,

    We just did not get enough requests for blob support on the MVS platform.

    Please contact Kim or Su and raise this as an idea for the communities.

    Regards,
    Amit


  • 21.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 20, 2021 12:10 PM
    Jonathan,
    Amit is correct. As of now we do not have a plan to support BLOB on z/OS. I'm told it was considered years back, but there was not enough demand. 
    I recommend submitting a Community Idea. Votes for the idea help us see who else would benefit from this.


    ------------------------------
    Kim Peelman
    Product Owner, CA Gen
    Broadcom
    Plano,TX
    ------------------------------



  • 22.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 29, 2021 03:12 AM
    hi Kim,

    this issue seems to have surfaced again on the very same module that I had (at one stage) working:

    TIRM030E: Application failed - Updates have been backed out
    TIRM031E: Failing procedure exit data follows:
    TIRM032E: Last or current action block id = 1673308122
    TIRM033E: Last or current action block name = ASC1WS01_CALL_LETTER_PREVIEW_WS
    TIRM034E: Last or current database statement = 0
    TIRM035E: Current statement being processed = 0000000001
    TIRM037E: ** Fatal Error was encountered ***
    TIRM149E: Error occurred in CA Gen supplied function: TIRXMGLB
    TIRM305E: Error could not locate value trying to perform external call
    TIRM046E: *** Processing terminated ***
    TIRM044E: *** Press OK to continue ***

    the calling module is:

    BSD Action Block: ASC1WS01_CALL_LETTER_PREVIEW_WS
    ___________________________________________________________________________
    1 +- ASC1WS01_CALL_LETTER_PREVIEW_WS
    2 | IMPORTS:
    3 | Work View in ws_blob_usage (mandatory,transient,import only)
    4 | xml_b64_2mb (mandatory)
    5 | EXPORTS:
    6 | Work View out ws_blob_usage (transient,export only)
    7 | pdf_b64_2mb
    8 | LOCALS:
    9 | ENTITY ACTIONS:
    10 |
    11 | CALL EXTERNAL Web Service "cubaPrevLetterBinary"


    I've spend considerable time with variations, changing view sizes etc.  Nothing.

    Is it possible to obtain a copy of the source code for TIRXCWS (even in obfuscated form), so that I can track down the error.

    Any help appreciated - this has become a high priority piece of work on our next major release ....








  • 23.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted Apr 29, 2021 03:15 AM
    I don't want to publish the complete WSDL on an open forum, but the relevant fragment is:

    <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="cubaPrevLetterBinaryReq" type="previewLetterReq"/>
    <xsd:element name="cubaPrevLetterBinaryResp" type="previewLetterResp"/>
    <xsd:complexType name="previewLetterReq">
    <xsd:sequence>
    <xsd:element name="OMEGA" type="xsd:string" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="previewLetterResp">
    <xsd:sequence>
    <xsd:element name="base64Binary" type="xsd:base64Binary" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    </wsdl:types>


    this works 100% using SoapUI.

    Are there any PTFs that could be relevant here ...


  • 24.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted Apr 29, 2021 09:23 PM
    Hi @Jonathan Hardy,

    Your question should be how to receive PDF from the web service to action block using blob?

    Now let me try to explain base64Binary definition as per https://www.w3.org/TR/xmlschema-2/#base64Binary

    base64Binary represents Base64-encoded arbitrary binary data. The ·value space· of base64Binary is the set of finite-length sequences of binary octets. For base64Binary data, the entire binary stream is encoded using the Base64 Alphabet in [RFC 2045].

    and in nutshell not exactly as PDF and hence it cannot be parsed back by the gen runtime.

    if your server is flexible and sends the PDF in the base64-encoded form,  then call external statement should be able to parse/read the response and put into the blob, and then you could do the reverse and decode this blob back into PDF from base64.

    for example, you could see the below page
    https://base64.guru/converter/encode/pdf  and look for the third party API's does the conversion from pdf to base64 and vice-versa.

    Hope this helps.

    Regards,
    Amit








  • 25.  RE: Re: How to receive a BLOB data from web service to action block?

    Posted May 09, 2021 11:19 PM
    hi Amit,

    We are able to successfully process pdf returned as b64 encoding, save this to a binary file, and browse the .pdf file in Chrome (or any pdf viewer)

    this is not the issue and has never been the issue.  the issue seems to be around certain wsdl's not being correctly parsed within TIRXCWS.

    I will send a more detailed summary at a later stage - just too busy working on our work-around solution to give this much time.

    Ideally we would like a exit for the SOAP BODY, not just the header.


  • 26.  RE: Re: How to receive a BLOB data from web service to action block?

    Broadcom Employee
    Posted May 10, 2021 04:34 PM
    Hi Jonathan,

    Glad to hear that you were able to process the pdf file successfully with call external.

    I would wait up for the issue summary and try to understand if this needs development effort.

    Could you please also elaborate on what exactly you are looking for in terms of exit for the SOAP BODY ...is it for request or response or for both?

    Regards,
    Amit