Notifications
Announcements
No record found.
hi,
i want to send word or pdf file generated from x++ code to send c# service . can you help me with this .
*This post is locked for comments
I assume you want to send the file from AX to an external WCF web service. Is that correct?
If so, the language used to develop the service isn't important.
Then I would use a byte array. although you could also encode your binary data (making up the file) to a string.
yes , i want to use byte array . but how to get byte array for word file , that is Com Object . it is not stored in database at that moment .
I thought you had a file. A COM object clearly isn't the same thing as a file. If you have access to the file, just forget the COM object and work with the file directly. If you have to work with the COM object (e.g. because you're making some changes), can't you simply save it to file?
When you have a file, the easier way is calling System.IO.File::ReadAllBytes(). Of course, it means reading the whole file to memory, which isn't optimal, but it may be good enough for your scenario. You can do it better with streaming, but I didn't want to make it too complicated from the very beginning.
i am generating a word file from code with dotx system draft resource . i want this file sent to c# service . i can get bindata from file that is stored in some location , on server , but my main goal is to get bin data of the file after i generate it from dotx file and fill it with bookmarks .
i guess i need to store this file on temporary location , and delete file afterwards . i am trying to use WinApi::getTempPath()) now and save file to this location. then get file from this location and therefore , get bindata . i dont want to save file on database or on file server .
You can use System.IO.Path::GetTempFileName().
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2