Using [delphi] MadExcept errorhandling with MS Exchange Server 2007 - delphi

I currently use madExcept.MailAsSmtpClient to send my bug reports. However a couple of large clients have upgraded to Exchange Server 2007 and we can't get the SMTP support for our app configured (the app runs on individual workstations so the messages aren't all coming from one IP. We can configure an authenticated account in exchange and access it via SMTP from other clients but it rejects madExcept for some reason).
So I have two questions
1) has anyone successfully configured that combo ? or
2) is there an example somewhere of how to use the madExcept.UploadViaHTTP option?

If you upload a madExceptbug report via HTTP a web server is required which accepts POST requests. The bug report parts will be posted as form parameters, encoded as multipart/form-data. PHP example code for HTTP upload can be found here: http://forum.madshi.net/viewtopic.php?t=4611

Related

Handling webhook calls in ASP.NET MVC application, implementation and testing

I have inherited this old ASP.Net MVC application and now I have to integrate a new Payment Service Provider. This PSP returns the responses to all payment requests via a POST message. The fields of the response are sent as hidden fields. The URL of the webhook must be provided in the request. After reading different SO posts along the same lines, I kinda know, in principle, what I would have to do. The PSP has a test & integration environment so I can send test request from my development environment. The problem I am facing is how to read the response. The URL for the webhook must be public, so me, running my development environment on my localhost, won't help. I can use webhook.site to get the responses, but I would like to get them in my application, so I check that my code behaves correctly and can handle properly the POST message containing all the hidden fields. Did anyone manage to find a possible solution for this problem?
TIA,
Ed
You mention that you want to test if you code behave correctly, I also see tag asp.net mvc in the post. For this requirement I can suggest you to go with azure. Azure have remote debugging feature which can easily help you test your code.
If you don't want to go with Azure, you can use ngrok software to make your localhost url public. This way you can trigger your code and debug it locally like remote debugging in azure.
There is one more way to test this thing very well. Just log the whole body of webhook (in logs or DB) and later execute it yourself through postman. This might doesn't let your webhook endpoint know the result at same time.

Consolibyte QuickBooks PHP Library - How Do You Debug / View Errors?

I am currently trying to import a list of customers from my QB installation using the _quickbooks_customer_import_request() and _quickbooks_customer_import_response() methods found in Consolibyte's QB PHP library in the docs/web_connector/example_web_connector_import.php file.
When I run Web Connector, it is able to establish a connection and receive the request from my server. It then errors out on the response (where QB contacts my server and tries to pass to it response data). The error shown in Web Connector is a generic getLastError() message:
When I look in the quickbooks_log table that the Consolibyte library created in the quickbooks MySQL database, I see the following:
The above doesn't show the reason for the error. How do I log the underlying errors here? I would prefer a solution where the detailed error description can be inserted into the quickbooks_log table in a JSON format.
There's a Troubleshooting section of the docs here:
http://wiki.consolibyte.com/wiki/doku.php/quickbooks_integration_php_consolibyte?s[]=troubleshooting#troubleshooting
You should start by putting the Web Connector in VERBOSE mode, and looking at what's in the Web Connector log file.
Also, check your PHP error log.
There's many different places an error could be occurring (PHP, configuration, SSL/TLS, QuickBooks, etc.) so start with the Web Connector log and go from there.

Inspect HTTP requests made by Apache Wink client

I'm using Apache Wink to access a service, and trying to debug a problem where the server apparently does not recieve my request in the intended format (details below, but are probably immaterial). Is there a way I can make the Wink client to log the HTTP requests that it makes to the server, so that I can see what is being sent down the wire?
Details: I'm using Eclipse Lyo to create a ChangeRequest in RTC (rational team concert) using their OSLC v2 REST APIs.(Eclipse Lyo internally uses Apache Wink). In doing so, even though I've set a "Filed Against" property in the ChangeRequest being submitted, RTC does not recognize it and complains that it is missing.
I think it's better to use a proxy to monitor the traffic. If your client runs on Windows, Fiddler is a very nice tool.

Unstable log4net emails with a Windows Service on a Windows Server 2003 R3 using Exchange Server

I am running a Windows Service on a Windows Server 2003 R2. We are using Exchange Server to send out the emails.
I am using log4net.dll 1.2.11.0.
I have situation where log4net sometimes sends emails and sometimes don't eventhough no changes has been made to the set up.
All the other log4net logging works very fine. And as said sometimes the application sends out emails and some times it don't, having made no change to the application.
All my methods are in try-catch clauses, but I don't get any errors.
When I run the the Windows Service on my local machine, the log4net email always works, and as said on the remote server, sometimes the log4net email works, sometimes it don't, having made no changes to the setup.
I am using log4net.Internal.Debug and have a System.Diagnostics.TextWriterTraceListener file where stuff is written to.
Scanning thorugh this file I haven't noticed anything in particular, but I don't know what specific to look for.
Any ideas about what the problem is or what to do?
If the SMTP appender cannot send an email it would log an exception with this text: Error occurred while sending e-mail notification. This would be visible if internal debugging is enabled. Maybe you have filters or something like that configured that prevents log4net from sending an email.
You could download the source code of log4net and add extra logging to the SMTP appender to find out if the "SendMail" method of the appender gets called at all. If it does and no email and no error is shown, then we need to assume that the exchange server somehow swallows the emails. If the appender is not triggered, then you need to review your filter / buffer / threshold configuration.
Alternatively you could try to use the SmtpPickupDirAppender.

SOAP server couldn't work correctly behind some proxy/firewall

I have a SOAP server/client application written in Delphi XE working fine for some time until a user who runs it on Windows 7 x64 behind a corporate proxy/firewall. The application sends and receives TSOAPAttachment object in the request.
The Problem:
Once the first request from this user is received and processed, the server could not process any request (from any user) successfully coming after this.
The server still response to the request, but the SOAPAttachment of the request
seems corrupted after the first one from this user, that's why it couldn't process the request successfully.
After putting may debug logs to the server, I noticed the TSOAPAttachment.SourceStream in the request's parameter become inaccessible (or empty), and TSOAPAttachment.CacheFile also empty. Therefore whenever trying to use the SourceStream, it will return Access Violation error.
Further investigation found that the BorlandSoapAttachment(n) file generated in the temp folder by the first request still exist and locked (which should be deleted when a request is completed normally), and BorlandSoapAttachment(n+1) files of the following request are piling up.
The SOAP server will work again after restarting IIS or recycle the application pool.
It is quite certain that it is caused by the proxy or the user’s networks because when the same machine runs outside this networks, it will work fine.
To add more mystery to the problem, running the application on WinXP behind the same proxy have no problem AT ALL!
Any help or recommendation is very appreciated as we have stuck in this situation for some time.
Big thanks in advance.
If you are really sure that you debugged all your server logic that handles the attachments to attempt do discover any piece of code that could failed specifically on Windows 7, I would suggest:
1) Use some network sniffer Wireshark is good for this task, make two subsequent requests with the same data/parameters values, and compare the HTTP contents. This analyze should be done both in the client (to see if the data is always leaving the client machine with the same content) and also in the server, to analyze the incoming data;
2) I faced a similar situation in the past, and my attempts to really understand the problem was not well succeed. I did workaround the problem sending files as Base64 encoded strings parameters, and not using the SOAP attachments. The side affect of using Base64 its an increase of ~30% in the data size to be sent, and this could be significant if you are transferring large files.
Remember that SOAP attachments create temp files in the server, and Windows 7 has different file access rules than Windows XP. I don't know if this could explain the first call being processed ant the others not, but maybe there are something related with file access.
Maybe it is UAC (User Access Control) problem under Win 7. Try running the client in win 7 "As Administrator" and see if it is working properly.

Resources