Jump to content

ertank

Members
  • Content Count

    233
  • Joined

  • Last visited

Posts posted by ertank


  1. Hello,

     

    There is a Win32 application used on a client. They face problem of "application freezing" randomly. Same binary is used in more than a single machine and this is the only machine having problems.

     

    That was not my decision, but customer could do it and they formatted the complete system, install Windows from scratch. That did not help. Since it is random (sometimes days of smooth running), I think remote debugging is not very useful here. Or, is it the only option?

     

    I would like to at least get a call stack when that freezing happens (they kill the application using task manager when that happens).

     

    Any help is appreciated.

     

    Thanks & regards,

    Ertan

     

     

     


  2. Hello,

     

    I have attached a project for re-production of my problem.

     

    When Windows scale is set to something higher than 100%, compiled exe display main form visible behind login form while login form is displayed as "ShowModal" in main form's OnCreate() event.

    I have worse problems further in my production application like complete freezing of application in other forms.

     

    However;

    - Delphi 10.2.3 generated EXE does not have that problem at all.

    - Delphi 10.3 exe does not have that problem (and any of other problems in my production application) if scaling set to 100% in Windows settings.

     

    I would like if someone else can confirm that is actually a problem of Delphi 10.3 Rio.

     

    I appreciate if anybody can suggest a solution/workaround.

     

    Thanks & Regards,

    Ertan

    Delphi10.3_forms.zip


  3. There are a lot of people seemingly asking about CLOB performance. Here are some links that I've found:

    http://betteratoracle.com/posts/45-the-performance-cost-of-clobs

    https://stackoverflow.com/questions/38776560/oracle-is-there-any-performance-hit-for-a-clob-column-that-contains-rows-with

     

    What timings do you get for both data types when you execute "select * from Xxxx" from command line Oracle SQL tool?


  4. 10 minutes ago, Daniel said:

    Cannot reproduce 😇

    I have just added "Rio" and "Community Edition" to list list- please scroll to the end.

     

    Thank you.

    It will be more clear for "Community Edition" to have version numbers, won't it?

     


  5. Try this: Write some long text in a TLabel.Caption or a TEdit.Text when you have a vertical scrollbar visible in Object Inspector.

    Your cursor will go under that scrollbar and you will not see what you are typing beneath. Same applies when you try to change existing long text.


  6. My knowledge, Delphi does not support namespaces in web services. I now believe, response cannot be parsed by Delphi because both request and response contain "namespaces".

     

    I sincerely hope both namespace and easy security header support gets introduced in following versions of Delphi.

     

    For now, I give up searching for a solution. I will be generating my own request XML by code, and I will be parsing incoming response XML by code using THTTPRIO.OnBeforeExecute() and THTTPRIO.OnAfterExecute() events.

     

    Thanks to everyone.

     

    Regards,

    Ertan


  7. I found how to use XML namespaces. Suggestion of @ergeka also works. It is possible to have same node name in different namespaces and that may result in a wrong node reading.

     

    I needed to match namespace identifier in XMLNode and pass string of that identifier indicated at the beginning of xml file.

     

    Thanks.

     

    const
      cac = 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2';  // can be found at the beginning of XML
      cbc = 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2';  // can be found at the beginning of XML
    
    
    function GetXSLTFromXML(const Filename: string): Boolean;
    var
      Xml: IXmlDocument;
      ElementNode: IXMLNode;
      BaseNode: IXMLNode;
      ChildNode: IXMLNode;
      XSLTBase64: string;
      XSLTBytes: TBytes;
    begin
      if not TFile.Exists(Filename) then Exit(False);
    
      Xml := TXMLDocument.Create(Filename);
      ElementNode := Xml.ChildNodes.FindNode('Invoice');
      if ElementNode <> nil then
      begin
        BaseNode := ElementNode.ChildNodes.FindNode('AdditionalDocumentReference', cac);
        while BaseNode <> nil do
        begin
          ChildNode := BaseNode.ChildNodes.FindNode('DocumentType', cbc);
          if ChildNode <> nil then
          begin
            if ChildNode.Text.ToUpper = 'XSLT' then
            begin
              ChildNode := BaseNode.ChildNodes.FindNode('Attachment', cac);
              if ChildNode <> nil then
              begin
                ChildNode := ChildNode.ChildNodes.FindNode('EmbeddedDocumentBinaryObject', cbc);
                if ChildNode <> nil then
                begin
                  XSLTBase64 := ChildNode.Text;
                  XSLTBytes := TNetEncoding.Base64.DecodeStringToBytes(XSLTBase64);
                  TFile.WriteAllBytes(TPath.ChangeExtension(Filename, '.xslt'), XSLTBytes);
                  Exit(True);
                end;
              end;
            end;
          end;
          BaseNode := BaseNode.NextSibling;
        end;
      end;
    
      Result := False;
    end;


     

     


  8. 23 minutes ago, Attila Kovacs said:

    Without hacking me into the sources or reading through the thread, did you format the imported wsdl unit in the IDE? Ctrl-D, or 3rd party?

    Because this wrapper unit is case sensitive and formatting can corrupt it.

    I did not. I used WSDLImp.exe and unit is what it imported. Code is not formatted.


  9. 5 hours ago, mausmb said:

    My guess is you have also REST available !?

     

    Solution : c# import that Service and wrap it to helper service (regular SOAP service) ... and import wrapped WSDL into Delphi

    Unfortunately, I do not have REST version of the same web service. Only SOAP. Probably government enforcement.

     

    I will see if I can find anyone familiar with C# and web services. I do not have enough knowledge of C# to import and then wrap for importing WSDL from Delphi.

     

    Thanks.

    Ertan


  10. Hello,

     

    Using Delphi 10.2.3. I have attached xml file. I would like to find specific node (if it exists) in it and retrieve it's value.

     

    My node existence check list is:

    1- AdditionalDocumentReference (This is an optional node. Can be more than once in XML. I have to loop through all of them to be sure that node I am searching for exists or not. If no such node exists, searched node is certainly not exists)

    2- DocumentType = XSLT (I am seaching DocumentType to be "XSLT". if current node is something else, I need to check other AdditionalDocumentReference nodes if there is any)

    3- EmbeddedDocumentBinaryObject (I need Base64 encoded string of that node)

     

    My current code is:

     

    uses
    
      Xml.OmniXmlDom,   // <- this is for Omni XML (only available in XE7 and higher!)
      Xml.XmlDom,       // <- add this (important, otherwise the var DefaultDOMVendor isn’t available) Using "Omni XML" as default DOM provider
      Xml.XmlDoc,
      Xml.XmlIntf;
    
    
    procedure DisplayInvoice(const Filename: string);
    var
      Xml: IXmlDocument;
      ElementNode: IXMLNode;
      BaseNode: IXMLNode;
      ChildNode: IXMLNode;
      XSLTBase64: string;
    begin
      if not TFile.Exists(Filename) then Exit();
    
      Xml := TXMLDocument.Create(Filename);
      ElementNode := Xml.ChildNodes.FindNode('Invoice');
      if ElementNode <> nil then
      begin
        BaseNode := ElementNode.ChildNodes.FindNode('cac:AdditionalDocumentReference', 'http://www.w3.org/2001/XMLSchema-instance');  // <--- here BaseNode returns nil
        if BaseNode <> nil then
        begin
          ChildNode := BaseNode.ChildNodes.FindNode('DocumentType');
          if ChildNode <> nil then
          begin
            if ChildNode.Text.ToUpper = 'XSLT' then
            begin
              ChildNode := BaseNode.ChildNodes.FindNode('Attachment');
              if ChildNode <> nil then
              begin
                ChildNode := ChildNode.ChildNodes.FindNode('EmbeddedDocumentBinaryObject');
                if ChildNode <> nil then
                begin
                  XSLTBase64 := ChildNode.Text;
                end;
              end;
            end;
          end;
        end;
      end;
    end;

    Above code does not take into account multiple AdditionalDocumentReference as I failed to have a working code in the first place.

     

    I have also tried not to use namespaces when using FindNode and that also failed.

     

    Any help is appreciated.

     

    Thanks & regards,

    Ertan

     

    ubl-tr.xml


  11. Hello,

     

    I tried to find solution to my problem in several places already including stackoverflow 

     

    When consuming a SOAP web service, response to a request comes in fine, but it is not populated in response object in code. I already provided details in above link. Let me know if they really need to be in this post, please.

     

    I added all files needed to test my case. I did not provide username and password as they are irrelevant to my problem. Below is an example code to use provided units.


     

    uses
    
      EFinans.EArsivFatura;
    
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Input: TFaturaOlusturInput;
    begin
    
      // required before calling any EFinans.EArsivFatura procedure/function 
    
      EFinans.EArsivFatura.URLEArsivFatura := 'https://earsiv.efinans.com.tr/earsiv/ws/EarsivWebService';
      EFinans.EArsivFatura.Username := 'someuser';
      EFinans.EArsivFatura.Password := 'somepassword';
    
    
    
      // preparing parameters
    
      Input.donenBelgeFormati := Ord(TGelenBelgeFormatlari.gePDF);
      Input.goruntuOlusturulsunMu := 1; // 0=hayır, 1=evet
      Input.islemId := TGUID.NewGuid.ToString().Substring(1, 36).ToLower();
      Input.vkn := '123456789';
      Input.sube := '000000';
      Input.kasa := '0000';
      Input.numaraVerilsinMi := 0;
      Input.faturaSeri := EmptyStr;
      Input.sablonAdi := 'einvoice_efinans_15_06_04_3.xslt';
      Input.erpKodu := 'ERP1';
      Input.gzip := 1;
      if not EFinans.EArsivFatura.AFaturaOlustur(Input, TGidenBelgeFormatlari.PDF, 'test.zip', 'test.pdf') then
      begin
        ShowMessage(EFinans.EArsivFatura.LastError);
        Exit();
      end;
    end;
    

    Above sample code will get you an error response from web service. That response will be saved in "response.xml" file in same directory as your EXE.

     

    If you debug and put a break point in line 237 of EFinans.EArsivFatura.pas you should see that Response.return is nil. That is my problem. I have same problem in other methods, too. Just trying to see how I fix this single one now.

     

     

    Thanks & regards,

    Ertan

    EarsivWebService1.pas

    EFinans.EarsivFatura.Utils.pas

    EFinans.EArsivFatura.pas

    response.xml

    test.zip

×