Developer forum

Forum » Integration » RequestExternalPdf multiple live integration components

RequestExternalPdf multiple live integration components

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

One question. We have one solution with two LiveIntegration components.
This is working very well for everything except RequestExternalPdf. Here we get an error, and we would like to knnow if this is a problem related to Business Central, or if it might be because we have multiple LiveIntegration components.

/Admin/public/CustomerCenter/RequestExternalPdf.aspx


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Martin,

 

Have you tried adding "&ShopId=XX" to your request?

 

Best regards, Anders

 
Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Martin,
if you have several Live integration add-ins and trying to execute the request for external PDF by RequestExternalPdf.aspx page then each of your add-ins will receive the
call of the method: public override void RetrievePDF(HttpRequest request, HttpResponse response)
in the LiveIntegrationAddIn.cs class. So the first found add-in is processing the request and makes a response
using: 
                response.OutputStream.Flush();
                response.OutputStream.Close();
and the second add-in will probably will not get the request because of that code.
Could you add some validation in your live integration solutions so it checks for which add-in the request is from and then if it is not "right" add-in just do nothing instead,
so the right add-in will send the request to its ERP?

You can make a check by sending some additional parameter in the request and check that value in the IntegrationCustomerCenterHandler.cs
method: internal static void RetrievePDF(HttpRequest request, HttpResponse response)

Kind regards, Dmitrij

Votes for this answer: 1
 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Thanks Dmitrij!
You were spot on, the second add-in did not get the request.

I added a parameter for shop id like Anders mentioned, and I check for it inside RetrievePDF.
It is now working as expected. We skip the code if it is not the correct shop id.

It is a bit "too hard coded", but it works for now.

 

You must be logged in to post in the forum