web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Webservice returning a PDF file

(0) ShareShare
ReportReport
Posted on by 172

Hello,

I'm thinking about a topic of using webservices to send PDF files.

As I know there is a possibility just of sending files the question is if I cant send a downloadable or readable file by the browser.

How could I archive that the returned file is usable rught away? Force to open it like a PDF file?

It's not just text so I can't pass read it and pass as a string, sending it binary would be no better since end user wouln't be able to use it.

Any advice would be nice.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Radek,

    Can you explain if and how this question is related to Dynamics 365 Finance?

  • RadekM Profile Picture
    172 on at

    Well bacause I want to use the AX365 Finance webservice to return PDF's of invoces or warehouse documents? The question is if AX is capable of return a file simply calling a service.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Can you explain your scenario, please?

    You said you wanted a web service, but then you talk about things like a browser or "to open like a PDF file", which doesn't seem related to a web service.

    Yes, F&O can offer a web service returning a PDF file, but if you want to give a file to use for download, you don't want a web sevice at all. You need File::sendFileToUser().

  • RadekM Profile Picture
    172 on at

    I was thinking if I can create a custom service that could return a file to a user outside of company without any other API.

    Like I would share a link to my service with encrypted parameters and the user who would open the link would get the file in a readable format. Since it would be mostly PDF's and not text files I wonder how to display it the right way.

    Ah right, just forgot one thing when I came up with this... Authorisation... without it, it won't most propably work this way..

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Web services are used for commication between aplications. If you want a user to access a web application, you don't need a web service and users don't need to know how to create HTTP requests, get OAuth tokens and things like that. Users use web browsers.

    Of course that public access to F&O isn't allowed - authorization is necessary.

    What you could do is create another application that would connect to F&O (it would deal with authentication and authorization), call the custom service and then make the file available to the user. Users wouldn't use the web service (that's for communication between the custom app and F&O); they would use the app.

  • RadekM Profile Picture
    172 on at

    It is actually a good idea to make a separate app that is authorized and use the returned data.

    In my case the user only need to know to open a link. Since my code would generate everything for that certain end user.

    Im thinking about it as a way to delive small files, since my country will start to use Electonic invoicing as mandatory and the only way to attach other files to the stream we send to gov API is to add links to files or send them via email os some custom app...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans