Jump to content
RadStudio 10.3.1 was released today Read more... ×

Mr. E

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

6 Neutral

About Mr. E

  • Birthday April 1

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mr. E

    How To HTTP POST in Delphi?

    Thank you Gambit/Remy Lebeau! 😀
  2. Indeed in my case, the solution is: backup and delete from the registry the guilty one, In my case my version is "..\BDS\18.0\.." This worked like a charm. Note that for me there was no registry key in the above path for OmniThread yet. Perhaps the key only gets written upon successful installation of the package. In that case you only need to delete the PackageName directory and reinstall. Thank you @FredS
  3. Regards, this problems occurs from time to time in getit now I got bitten again. Hopefully someone knows how and where I can tell to Getit that EurekaLog isn't installed so I can reinstall it. This is the little story: I got the EurekaLog Tools (free) v 7.0 installed, today I see the new version 7.7.5.0. and I do this: EurekaLog Tools 7 was installed via Getit Without uninstall the v7 in getit: I install the v7.7.5.0; the process goes without error, and the install remove the previous one, the IDE restarts; (I was expecting that Getit remove the old one and take out from Getit but no). In Getit now I see two versions installed. (annoying), then In Getit I uninstall the v7, it removes in GetIt and from Programs and Features too. Now I don't have the programs installed (but Getit shows as installed). In Getit that shows 7.7.5.0 is installed, when I try to uninstall, I got this error, and I can't reinstall again: This happens with other package, but I don't remember how I "remove it", still get it shows the old version to install, as a reminder that I don't remember Thanks in advance.
  4. Mr. E

    How To HTTP POST in Delphi?

    @Kryvich THANK YOU! (I'm screaming, Yes!) This is like seeing a sunrise and wondering how it's this possible? 🌞 I'm reading your code, is slick and to the point. This isn't trivial for anyone without previous knowledge, I need a lot of theory to learn (web, sockets, mORMot, etc.) -- How can I mark the post as solved (with a lot to read/learn) ?
  5. Mr. E

    How To HTTP POST in Delphi?

    Found something that I need to read & learn: HTTP - requests. For someone like me, stuck just with desktop apps, is a must read.
  6. Mr. E

    How To HTTP POST in Delphi?

    This! Now I need to learn how fill the parameters, as the example provided: POST https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl HTTP/1.1 Content-type: text/xml;charset="utf-8" Accept: text/xml SOAPAction: http://tempuri.org/IConsultaCFDIService/Consulta cache-control: no-cache Host: consultaqr.facturaelectronica.sat.gob.mx accept-encoding: gzip, deflate content-length: 414 Connection: close <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:Consulta> <!--Optional:--> <tem:expresionImpresa><![CDATA[?re=LSO1306189R5&rr=GACJ940911ASA&tt=4999.99&id=e7df3047-f8de-425d-b469-37abe5b4dabb]]></tem:expresionImpresa> </tem:Consulta> </soapenv:Body> </soapenv:Envelope> Looking the mORMot unit/doc and searching for examples. Thank you!
  7. Mr. E

    How To HTTP POST in Delphi?

    @KryvichThank you, I appreciate your work. The problem: the sat.gob.mx has been doing changes to their web services, this is the second variant of the w.s., and they decide to hide the wsdl for this and many others services. Luckily an authorized certification provider (PAC) create this test service, cloning the functions of the real w.s. Hiding the wsdl services is forcing us to use it using a HTTP POST Request in Delphi. This is what I seek to learn, preventing more changes in the future. This sat is tied to m$ technologies, leaving us (the Delphi devs.) with the burden to adapt our approach to each changes or new services they publish. Again thank you very much.
  8. Regards, I'm searching how to create an HTTP POST request, but I can't manage to do it. This is a SOAP Service that I can consume using the ?wsdl (now is hidden); but some nice provider write this: POST https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl HTTP/1.1 Content-type: text/xml;charset="utf-8" Accept: text/xml SOAPAction: http://tempuri.org/IConsultaCFDIService/Consulta cache-control: no-cache Host: consultaqr.facturaelectronica.sat.gob.mx accept-encoding: gzip, deflate content-length: 414 Connection: close <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:Consulta> <!--Optional:--> <tem:expresionImpresa><![CDATA[?re=LSO1306189R5&rr=GACJ940911ASA&tt=4999.99&id=e7df3047-f8de-425d-b469-37abe5b4dabb]]></tem:expresionImpresa> </tem:Consulta> </soapenv:Body> </soapenv:Envelope> I try something like this, using Indy; but the web is a dark box for me in Delphi. // I'm trying using the REST clients, the Indy Http, ... uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Xml.xmldom, Xml.XMLIntf, Vcl.ComCtrls, Xml.Win.msxmldom, Xml.XMLDoc ,Vcl.StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, Xml.omnixmldom, IPPeerClient, REST.Client, Data.Bind.Components, Data.Bind.ObjectScope, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL; ... uses IdMultipartFormData; ... procedure TForm3.Button3Click(Sender: TObject); var data: TIdMultiPartFormDataStream; begin data := TIdMultiPartFormDataStream.Create; try // add the used parameters for the script data.AddFormField('expresionImpresa', '?re=LAN8507268IA&rr=LAN7008173R5&tt=5800.00&id=4e87d1d7-a7d0-465f-a771-1dd216f63c1a'); // Call the Post method of TIdHTTP and read the result into TMemo Memo1.Lines.Text := IdHTTP1.Post('https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc', data); //ERROR //HTTP/1.1 415 Cannot process the message because the content type 'multipart/form-data; boundary=--------111018174150958' //was not the expected type 'text/xml; charset=utf-8'. //--------------------------- finally data.Free; end; end; procedure TForm3.Button2Click(Sender: TObject); var S: TStringList; M: TStream; begin S := TStringList.Create; M := TMemoryStream.Create; try S.Values['expresionImpresa'] := '?re=LAN8507268IA&rr=LAN7008173R5&tt=5800.00&id=4e87d1d7-a7d0-465f-a771-1dd216f63c1a'; //'![CDATA[?re=LAN8507268IA&rr=LAN7008173R5&tt=5800.00&id=4e87d1d7-a7d0-465f-a771-1dd216f63c1a]]'; IdHTTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1; //IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded'; IdHTTP1.Post('https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc', S, M); Memo1.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); Memo1.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); // ERROR: //HTTP/1.1 415 Cannot process the message because the content type //'application/x-www-form-urlencoded' was not the expected type 'text/xml; charset=utf-8'. //--------------------------- M.Position := 0; S.LoadFromStream(M); Memo1.Lines.AddStrings(S); finally S.Free; M.Free; end; end; Consuming the web services is a lot easier, just I need to Import the WSDL (is hidden right now but I still manage to get before), create the unit and start using the service, the consume is just: procedure TwsConsultaCFDIEmpresa.doConsulta (const representacionI : string); var ics : IConsultaCFDIService; vAcuse : Acuse2; begin try ics := GetIConsultaCFDIService(false); // representacionI is something like: // ?re=LAN8507268IA&rr=LAN7008173R5&tt=5800.00&id=4e87d1d7-a7d0-465f-a771-1dd216f63c1a vAcuse:= ics.Consulta(representacionI); finally with vAcuse do ShowMessage(CodigoEstatus +'/ '+EsCancelable +'/ '+ Estado +'/ '+EstatusCancelacion); end; end; I need to read some basic documentation, but alas, I don't know how to start. Maybe with a working example can I go forward. I don't know if using the "REST clients" are something that I need. Edit: Using Firefox I got an extension named "Httprequester" but I can't make a successful request/POST. Thanks in advance
  9. Mr. E

    Mute a topic?

    I wonder if there is a way of mute topics that aren't interested for me and got a lot of attention/posts that make it shows over and over. Using the "Fluid" option allows to see only that Forum, but sometimes a lot of topics are a little "annoying". Then if I want to read it again, unmuting that topic can be helpful too. (Thinking twice, seems like this topic is a good & bad example ) Regards
  10. Mr. E

    How to start?

    Thank you @Primož Gabrijelčič, now I know what to read & learn "7.12 OmniThreadLibrary and COM/OLE" Edit: Seeing your recommendation about VCL; if I need to update a TListView with the output of each call of the web service, then I'll need to divide my code so I can update that VCL controls. 💭 Edit #2: @Primož Gabrijelčič Is correct this approach? Asyn(do_something_with_the_webservices) .Await( procedure begin // Can I update ListView controls here? // ... more code inside end); Edit #3 . (To myself) First read the docs, then ask later! [ self.slap ] ..
  11. Mr. E

    Bookmarks in the forum?

    Good to see other options and some with a price$ In the meantime I'll try to use "Follow" Thank you for the responses!
  12. Is possible to add this feature: Bookmarks ? From time to time I read some very interesting post, that qualify as tips & tricks that need to be bookmarked for further reference. Maybe it exists and I don't know how to use it; this forum is full of features. I use other forums that use "discourse" and have this useful feature.
  13. Mr. E

    How to start?

    Hence the nature of this post, for the new users of this great library. But it's official, I need to read more documentation of OTL, learn and be aware of changes that need care, Delphi really do a great job lifting the weight for us. I manage to fix one application; and I got a some more that can beneficed using OTL. Some other app trows me an unexpected AV error, it just consume another web services, open some xml file, inspect that some elements are present then upload to that service. At the end, closing the app got this: Delphi and threads: “System Error. Code: 1400. Invalid window handle (need to read tomorrow and fix it) Regards!
  14. Mr. E

    confusing

    OK, I can't find any star/circle using Waterfox+Linux/Manjaro. By circle you mean the "avatar/circle" at the right? If I hover the mouse over a topic I can see the start of the post and a second tab with (maybe) the fist/last unread post.
  15. Mr. E

    How to start?

    @Primož Gabrijelčič, yes the exception pops up. I remotely connect to my office to check it, and now I see that I'm using and OTL old version, updating now. The exception occurs, following @Schokohase advice and was right. Looks like access that web services needs your advice to works. So I need to add "ActiveX" on the uses clause: uses ... , ActiveX , OTLparallel; // add the procedure TForm1.doConnectionToService begin try CoInitialize(nil); //... wsServicio := Servicio.GetServicioSoap(cbUseWSDL.Checked); //... except on E : Exception do begin //... end; end; CoUninitialize; end; // on my clic event procedure TForm1.bbConectarClick(Sender: TObject); begin bbConectar.Caption:= 'Comprobando Acceso...'; bbConectar.Enabled:= False; // The old annoying unresponsive way: // doConectar; // bbConectar.Caption:= '&1) Comprobar Acceso'; // bbConectar.Enabled:= True; // The new code without unresponsive GUI! Thank you Primoz G. Async(doConectar) .Await( procedure begin bbConectar.Caption:= '&1) Comprobar Acceso'; bbConectar.Enabled:= True; end); end; Maybe there need to be a new entry in the OTL FAQ because I don't find any reference (I wasn't searching thoroughly). Thank you for the help! Regards
×