Jump to content

TrevorS

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

3 Neutral
  1. Embarcadero® RAD Studio 10.4 Version 27.0.38860.1461 Delphi 10.4 and C++ Builder 10.4 Update 1
  2. I have created an API in Node.JS serving data and PDFs to my Angular front end - all works perfectly. I've also added the PDF bit onto an existing Delphi App that my company uses. There are 5 difference classes of PDF document. The Delphi app works 100% of the time, for all PDF types when I compile it for Mac OSX, however, when I run the Windows version, I get problems with 2 document types - 3 work perfectly (I can also use Postman to get the PDFs without any errors on all types) I create the PDFs on the fly in the server, and the problem PDFs are created from the same bits of server code as the ones that fail. Error: No mapping for the Unicode character exists in the target multi-byte code page I've tried changing the headers sent from the server, and also varied the request headers: I've tried different Content-Types and specified the charset=utf-8. The simple Delphi code bellow, works for all PDF types on the Mac, but only works for a subset of the document types on Windows. (It's the RESTRequest.Execute bit that fails) RESTClient.BaseURL := 'https://api.mysite.com/pdf/' + url; RESTREquest.Method := rmGet; RESTRequest.Params.AddItem; RESTRequest.Params[0].Kind := pkHTTPHEADER; RESTRequest.Params[0].ContentType := ctTEXT_PLAIN; RESTRequest.Params[0].Options := [ poDoNotEncode ]; RESTRequest.Params[0].name := 'authorization'; RESTRequest.Params[0].value := 'Bearer ' + Token; RESTRequest.Execute; if RESTResponse.StatusCode = 200 then begin RespBytes := RESTResponse.RawBytes;
  3. I found the answer in this post https://en.delphipraxis.net/topic/2258-need-help-adding-namespaces-to-soap/ InvRegistry.RegisterMethodInfo(TypeInfo(NAV_ExportCustomerItemPriceV1Soap), 'NAV_CustomerItemPriceV1', 'ReadMultiple', '[ReturnName="NAV_CustomerItemPriceV1Result"]', IS_OPTN); Params are: TypeInfo, InternalName, ExternalName, ReturnName, XMLOptions Setting ExternalName appears to have fixed it
  4. The Delphi WSDL Importer has done an impressive job of taking a (local) WSDL file and generating some very useful code (that almost works!) To debug, I have looked at the outgoing request with Fiddler, and based on this, I've been able to alter the WSDL file to effect a required change in the request header. However, the problem remains that Delphi is generating a tag with "NAV_CustomerItemPriceV1" but the server needs "ReadMultiple" - ( which seems sensible of Delphi as the resource that it uses is called NAV_CustomerItemPriceV1) Despite further manual changes to the WSDL and to the code generated by Delphi, I can't force a change in this tag. I have seen posts where people have suggested intercepting the XML, but I'm not sure how to do this (or how to access the events on THTTPRIO) TIA Incorrect: <NAV_CustomerItemPriceV1 xmlns="http://tempuri.org/"> <customerNo>account_no</customerNo> <apiKey>api_key</apiKey> <itemList> <Item No="T14727IO" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" /> <Item No="ZT62062-T1E0100Z" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" /> </itemList> </NAV_CustomerItemPriceV1> Correct: <ReadMultiple xmlns="http://tempuri.org/"> <customerNo>account_no</customerNo> <apiKey>api_key</apiKey> <itemList> <Item No="T14727IO" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" /> <Item No="ZT62062-T1E0100Z" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" /> </itemList> </ReadMultiple>
  5. TrevorS

    caFree & ,Free??

    I have made the changes you suggested - I moved the SaveFormPos to the OnClose event of each form. I did spot an extra call to SaveFormPos in one of the branches ... so that's gone. Thank you very much for your help, it is most appreciated
  6. TrevorS

    caFree & ,Free??

    I have a project that runs in OSX only, Just moving it to Delphi 10.4.1 (I've seen the occasional memory exception when I close [Order Detail] - but I can't recreate it) Is the nil/freeandnil the best way to deal with nested modal forms in a Firemonkey/OSX? All of the [forms] are modal and are created / freed in the same way. TIA Trevor | [Customer Search] -- [Add Customer] -- [Postcode Search] (for account record) | Main -- [Order]-| [Postcode Search] (for del address) | | | | [Part Search]-- [Add Part] | [Order Detail] | | [Add Part] var f: TModalForm begin f := TModalForm.Create(nil); f.var := 100; try SetFormPos( f ); if f.ShowModal = mrOk then begin // do stuff ; // callingForm.var := f.var end; finally SaveFormPos( f ); FreeAndNil(f); end; end;
  7. TrevorS

    Adding a new SDK for MacOS fails

    Fantastic, that seems to have fixed it. Thank you for your help ­čÖé
  8. TrevorS

    Adding a new SDK for MacOS fails

    I´╗┐f y´╗┐´╗┐ou installed Delphi fro´╗┐m sc´╗┐ratch, you'll still need to apply the patches (there's 4)´╗┐ I used RADStudio-10-4-1-esd-1461.exe to install, then I applied 3 patches as suggested by GetIt /usr/bin/xcodebuild -version -sdk´╗┐´╗┐ xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance I think I have both the Tools IDE and the Commnad Line Tools installed ....
  9. TrevorS

    Adding a new SDK for MacOS fails

    I noticed that 10.4 had received a patch so I thought I'd create a fresh install (Windows and Delphi). However, I can't add an SDK for OSX ... nothing is displayed in the SDK manager. Like pyscripter "When I try to add a new SDK nothing happens." I can't try the workaround above - 1 - I don't have folder to rename - is this my username Documents? 2- I don't have an entry in the SDK Manager Xcode seems to be installed correctly Have I missed something? Thanks
├Ś