I'd approach the problem like this. Go get Fiddler[^], install, run, and start a capture.
Start Chrome and go through the extension you used before to successfully connect. Then, start your code and attempt the same connection.
Stop the capture in Fiddler and start looking through the capture to see exactly what was sen to to SAP to get a good response and compare that to what your code is sending. There's probable something missing in the headers or something like that you you're cod is going to have to add.
System.ItDidntWorkException: Something didn't work as expected.
I have a vb.net 2010 desktop application that I need to make a change to.
When the application runs, it runs in some predetermined size. The users are not able to drag the width or length arrows to increase the size of when the application runs on their desktops. They would like to increase the size of the application since they cannot see some of the wording.
Thus can you tell me what I can do:
1. Increase the default size of the application when it runs on a users desktop? and/or
2. Allow the user to adjust the size of the application when it is actually executing? Increasing the width and/or length of the application?
I've only been programming in VB for about 25 years
So the 90's were your training ground, I started writing macros in Excel 1 somewhat earlier. There seem to be a plethora of old farts here on CP
Some places won't let you write to the registry and there is no guarantee someone doesn't want to go fiddle with the settings. User data folder is more specific if required and no more difficult to use than the registry. It is also probably faster.
Never underestimate the power of human stupidity
I am trying to download pricing data from Commonwealth Edison via their recently published Hourly Pricing API. This uses GETs from defined HTTPS URLs, and I have confirmed that typing the appropriate calls into a Web Browser results in the return of the data in the expected format. My code is as follows:
wc = New WebClient
strGet = "https://hourlypricing.comed.com/api?type=5minutefeed&datestart=201708040835&dateend=201708041035"
strResult = wc.DownloadString(strGet)
In the real Application, strGet is put together by other code, but I have checked that this is working correctly. The code here aborts with a ThreadAbortException in System.dll at the DownloadString call. If I substitute an HTTP location on one of my sites for Comed's HTTPS location in strGet, everything works as it should, and the file data is retrieved.
I have researched this and tried a number of suggested 'cures' for problems with HTTPS connections under VB.NET, but the problem persists.
My browser delivers the content of the URL without problems.
I do have a regular (McAfee) firewall, but, as noted, it is not interfering with the browser accessing the same location.
I have no idea how Comed's server is configured. I have a fairly standard install of Windows 10, and am having no difficulty accessing other sites, including a lot which use SSL.
Running exactly the code I gave as a standalone function produced the same error on my system, but it also produced the following 'informational' message from VS: "Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation." I wonder if this is a debugger issue. I have to drop this for now, but will return to it and report back in a couple of days when I can get back to it.
The problem seems to be what I can only describe as a deficiency in the Visual Studio environment - the clue was the information message described in my previous response.
My usual way of testing an isolated Sub or Function while I am developing an application is either to invoke it directly from the Immediate Window, or, if this is not convenient (as it frequently isn't), to write a stub Sub which uses it and invoke that from the Immediate Window. This has always worked for me before. It appears that there is an issue with doing this to test (at least some) WebClient code, presumably because of some aspect of how code invoked from the Immediate Window is interpreted and run. If I put the code clipping from my first message in the Form_Load Function of a Windows Forms App and run the App, the code runs normally and returns the expected JSON string. If I put the identical code in a Public Sub and invoke the Sub from the VS Immediate Window, it throws the ThreadAbortException that I originally described. Perhaps the most bizarre aspect of this is the fact that the misbehavior is dependent on the URL in the request being an HTTPS one - as I noted, requests involving HTTP URLs are handled correctly, even when the code is run from the Immediate Window.
I am writing a client program in VB6 which will interface to a server over HTTP. The company who runs the server provided me with a certificate file called SomeCertificate.p12.
My program is running on Windows XP. This is the operating system the customer is using.
I am trying to find how to use this certificate when sending requests to the server.
Here is what I have done so far:
Copied the certificate file to my test computer.
Using Internet Explorer V8, I did "Tools|Internet Options|Content|Certificates|Trusted Root Authorities" and imported the certificate.
Installed the winhttpcertcfg tool.
Ran the following from command prompt:
"winhttpcertcfg -i SomeCertificate.p12 -c LOCAL_MACHINE\My -a COMPUTERNAME\USERNAME -p PasswordFromServerCompany"
the output was something like this. I replaced the different tokens with dummy strings:
Private key access has already been granted for account: COMPUTERNAME\USERNAME
My VB6 code looks something like this:
Private WithEvents m_ServerObj As WinHttpRequest Set m_ServerObj = New WinHttpRequest m_ServerObj.Open "GET", "https://serveraddress"
The Send call causes an exception: "A certificate is required to complete client authentication"
I tried different strings in the SetClientCertificate call but I keep getting the same error.
I'd appreciate any help and tips. What am i doing wrong? Is my code wrong? Did I use winhttpcertcfg incorrectly?
VB6 has effectively been "dead" for over 15 years. You'll struggle to find documentation or support for it, since most people have moved to .NET by now. With the release of Visual Studio Community[^], so long as you're within the limits, you can upgrade for free.
His commentary on VB6 was not directed at the problem at hand but the code you're writing by your language of choice. Since VB6 has been dead for so long, how long is it going to be before the runtime no longer works on Windows and you, or some successor, will be rewriting this thing in a modern language?
System.ItDidntWorkException: Something didn't work as expected.
Perhaps that file does not exist. This is the first thing to note, if the file does not exist how can you even read it?
Also, you did not mention which language you are using? You are in the Visual Basic forum and only mentioning Visual Studio here. I will assume you want to use the C# library (or VB.NET, they are both same). c# - SQLIte unable to open database - Stack Overflow
Secondly, it might be that the server or program requires some additional permissions so that the library can properly connect to the database. There is a long conversation and they all boil down to the permissions (read and write, both) of your database + directory where that file is, so that SQLite can easily update the data in the database.
For simplest of the tasks, you should try using this Firefox addon for SQLite manager, and see if it can access and open the database for you: SQLite Manager :: Add-ons for Firefox... It will help you understand whether there is a problem or not.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
All my apologies I program under visual studio in csharp. And I installed sqlite server 3.9.1. I would like to know if I need to uninstall and use firefox ??
And how do I go about doing the exe and install it on another computer
Since the repost in the VS-category is newer than this thread, I'm assuming you're still struggeling with the concept. SQLite is not a server-database, it is meant as a lightweight database-solution for local usage of your application. That gives SQLite some advantages and some disadvantages over a server-product.
Richard linked you the System.Data.SQLite page; that wiki explains how to use and deploy SQLite. You'll probably end up xcopying two files along with your executable.
Some other points; if you have been "searching for five months" than you have wasted time that you could have used to read the documentation. Next, "help me" is not a decent subject-line. Everyone who posts here is looking for help - and your question is rather specific to SQLite and C#.
So, post your code, and let us see how you connect to your datafile. Once we have code, we can talk about possible locations where things can go wrong and what it is exactly that you need to verify.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]