Original Message:
Sent: Thu May 02, 2024 11:22 PM
From: Prathamesh Dixit
Subject: PDF attachment handling in response
Hi Joseph,
Thanks for your revert again.
I am looking for both possibilities.
1. Client retrieving the PDF from datapower - Which I believe will be simple passthrough response rule?
2. Datapower sending pdf directly to file share location? Can var:service/routing-url in response rule help me to send it directly to file share location?
ABOUT FILE SIZE - No. I do not care much about the size much at this moment. However, I would be happy to set it just to avoid any parsing errors on xml manager - without causing any load to datapower - especially heavy files if any.
Prathamesh
------------------------------
Prathamesh Dixit
Original Message:
Sent: Thu May 02, 2024 01:00 PM
From: Joseph Morgan
Subject: PDF attachment handling in response
Last question answered first: Yes, just use a Results action in the response or use the gatewayscript urlOpen.open(..) method. If using a Results action, be sure to set the rule to non-XML (which you likely have to do anyway).
So, what I would do: Configure/Program the backend to limit the size of the response. Otherwise, you are processing the binary in DataPower, which you can do, but I would think that is better suited to the PDF generator rather than DataPower.
Do you still care about the size of the generated PDF if you're sending it to a file share?
Will the client retrieve the PDF from the file share, or will DataPower still return the document to the client?
------------------------------
Joseph Morgan
Original Message:
Sent: Thu May 02, 2024 01:44 AM
From: Prathamesh Dixit
Subject: PDF attachment handling in response
Hi Joseph,
Thanks for your time and revert.
So, the more information is, integration will be like :
Front app --> REST API JSON --> Datapower --> https backend application
Front app will be sending json message (POST I consider) , which will be converted into Pdf file from backend system and returned back.
Also, is there any ways that I can send the PDF from datapower to any fileshare location in response? It will be something like :
Request : Front app -- > Datapower --> Backend generates PDF
Response : Generated PDF on backend --> Datapower --> Fileshare Location
------------------------------
Prathamesh Dixit
Original Message:
Sent: Tue April 30, 2024 09:08 AM
From: Joseph Morgan
Subject: PDF attachment handling in response
I suspect you already know the request as a GET (I suppose). That is, there are a million ways to request a PDF, and that depends wholly on how you have your infrastructure configured. If that part is a mystery, you'll need to provide more information on where the PDF resides and what protocol is needed to fetch it.
For returning it to the requesting client, I would recommend just using a pass-thru response ( by selecting pass-through for the response rule on the gateway configuration itself ). The response rule needs to be nothing more than a match all and results... though it will not be used.
I'm a bit curious why you're worried about response size. It seems to me the document sizes should be controlled by the storage mechanism, or if the documents are dynamically generated, by the generating mechanism. Unless, hmmmm, these documents are not directly in your control.
To control this, you might can get away with examining the content length header (easy way if the document size is represented there). Otherwise, look into the document-size XSL extension function. With this, though, you'll also need to consider the document size settings of the associated XML Manager so you can parse and examine the size.
------------------------------
Joseph Morgan
Original Message:
Sent: Tue April 30, 2024 01:01 AM
From: Prathamesh Dixit
Subject: PDF attachment handling in response
Hi team,
I am looking for a case where client will be triggering a request to datapower to fetch pdf file (2/3mb) in response.
Can you please guide how this can be achieved from MPGW?
Client request will be REST or XML.
Response will be one pdf file.
For every call we are looking for one pdf in response.
Also please guide on how the attachment size can be restricted.
Thanks !
-Prathamesh
------------------------------
Prathamesh Dixit
------------------------------