Steve-Wootton / Dynamics-GP-eConnect-Transaction-Explorer

The eConnect Transaction Explorer is a graphical front end application for Microsoft Dynamics GP eConnect.
Boost Software License 1.0
0 stars 2 forks source link

Error Login failed for user #8

Open rokenbuzz opened 1 year ago

rokenbuzz commented 1 year ago

I'm new to eConnect but looking into it with the hope of ultimately making some batch changes to some orders I have in GP from a my own C# application. As I stumble through some GP provided C# samples that use the Microsoft.Dynamics.GP.eConnect and Microsoft.Dynamics.GP.eConnect.Serialization dlls, I am unable to successfully connect. Looking for help, I found this app and gave it a try. I'm running on my developer PC and hitting my remote GP server's database. In the Settings, Test Connection on the DYNAMICS and Company databases are successful. I'm choosing the "Use a specific user name and password" option. But when I generate some XML in your app, Executing it gives me:

eConnectOut: Failed Error Login failed for user ''

One thing that slightly concerns me, when I navigate back to my Connection settings, the "Blank password" checkbox is checked. And the Password textbox is empty. And "Allow saving password" doesn't seem to do anything obvious. It makes me wonder if the code is even using my password once the Settings dialog is closed.

Any ideas?

Steve-Wootton commented 1 year ago

I can try. You're actually the first person who has ever contacted me about my application, so we may have to work through this together. I think the solution to your issue is simple, but you may have run into some coding problems that I will need to fix.

Below are the connection properties that I am currently using for my TWO database connection. The DYNAMICS connection properties are identical except for the name of the database.

I have selected the Microsoft OLE DB Provider for SQL Server in the Provider tab:

Remote Desktop Connection - Provider Tab

In the Connection tab, I have the following settings:

Remote Desktop Connection - Connection Tab

It sounds like you have a valid login with the database as the Test Connection button returned successfully.

You should definitely have Allow Saving Password checked or the application won't save your password in the config file. ​If the password isn't saved in the config file, you'll get a login failure message from the database as the application is attempting to login with a blank password.​​

Checking the Blank Password checkbox will cause the password in the ​application's ​config file to be set to an empty string. ​Some applications require you to check Blank Password intentionally so that ​a password will not be stored in a config file, but ​doing so requires the user to enter the password each time they restart the application.​ My application expects a valid password in the config file, so you do not want Blank Password to be checked. Checking Blank Password will also result in a login failure message from the database.

Can you try checking the Allow Saving Password checkbox and unchecking the Blank Password checkbox to see if that resolves the login issue? If not, I'll have to dig into the code to see if I can find the problem.

Thank you for giving my application a shot and letting me know that you encountered a problem. If you have any questions about eConnect, please let me know and I'll try to answer them.

rokenbuzz commented 1 year ago

Thank you! It looks like my mistake was choosing SQL Server Native Client 1.0 instead of Microsoft OLE DB Provider for SQL Server. I saw SQL Server and never looked back. Ooops.

Still, now when I Execute I get:

eConnectOut: Failed Error @oErrString is not a parameter for procedure eConnectOut.

Steve-Wootton commented 1 year ago

Sounds like you are trying to execute the RQeConnectOutType transaction. I've tested several of the available eConnect transactions but not all. That's one I didn't test. I'll take a look at it when I can, but it may not be until tomorrow. Have you tried any of the other transactions? So long as the Commit Successful Transaction checkbox in the eConnect XML box is not checked, any transactions you execute will not change anything in the database. It's a convenient way of testing a transaction without worrying about changing data.

One thing I should have mentioned more in the help info is that the eConnectProcessInfo node does not work. eConnectProcessInfo functions differently than most of the other eConnect nodes and has no real use in this environment. It's intended to override the default database connection that is required by the eConnect service. This application does not use the eConnect service, and it doesn't do anything special with the eConnectProcessInfo node. I left it in for completeness but it doesn't do much but generate errors if you try to use it.

rokenbuzz commented 1 year ago

I am indeed trying to use RQeConnectOutType. The long story is: The company I work at uses the GP webservices SDK to interact programmatically with GP. Not the eConnect API. My attempts to change the SalespersonKey on a SalesOrder resulted in exceptions: A validation exception has occurred. Validation Errors:

I'm a novice GP developer and after some googling and failure to find a solid understanding/solution I wondered if the eConnect API might lead me to success. Of course I was hoping it would be a simple effort to give it a try, but alas. I found the Microsoft.Dynamics.GP.eConnect and Microsoft.Dynamics.GP.eConnect.Serialization dlls and eConnect Samples folder on my GP server, and hoping I was on the fast track to success, copied them to my development PC, built the RequesterConsoleApplication in VS and stepped through it, and encountered connection issues. As I got a little smarter about things and recognized:

  1. my dev pc is on a different domain as my GP server. This could contribute to some issues.
  2. the econnect dlls default to connecting to the local eConnect Integration Service which I haven't installed, evident by the exception: The pipe endpoint 'net.pipe://localhost/Microsoft/Dynamics/GP/eConnect/EntityOperations' could not be found on your local machine.
  3. deviating from this may be possible, using eConnectMethods.RequireProxyService = false
  4. changing the connection defined in app.config may be important, but the eConnect Samples are all missing their app.config files, and finding an example on the internet has proven fruitless for me. This is why I started looking into github for any eConnect examples that might have an app.config I could model from, and I then found your application.
  5. Maybe using your application would help me understand if what I'm trying to do is possible, from establishing a working connection across domains to ultimately successfully changing a sales order in the way I want.
  6. While I might continue to use your application in some capacity, I'm currently heading down the path of installing the eConnect Integration Service locally with the hope of configuring it to work across domains, and getting the sample application to run properly. The installation guide puts me on the fence on whether this will work. And I'm still a little uncertain if it is absolutely needed locally, given we have an instance installed and running on our GP server, but I'm looking for any working path at the moment, not necessarily the best one.

I did just try some other transactions in your app, sort of. By doing File > Load eConnect XML File, and choosing taSopHdrIvcInsert.xml from your eConnectFiles folder, I get an Error dialog that says: The transaction "taSopHdrIvcInsert" was not found. Error occurred at eConnectTransactionExplorer.Form1.LoadFile(String filename) at eConnectTransactionExplorer.Form1.Load_eConnect_File_ToolStripMenuItem_Click(Object sender, EventArgs e) I got the same type of error with taSopLineIvcInsert.xml, so I stopped trying to load files. I then tried manually creating a number of different requests using the UI but I haven't been able to get any XML to show up again in the eConnect XML section. I'm looking around the UI like I'm missing something obvious. I did this before without thinking, so what am I missing now?

Steve-Wootton commented 1 year ago

In response to your points above:

  1. If you can connect locally from your computer to the database on the remote GP server, then I think you should be okay.
  2. The eConnect DLLs assume that you have the eConnect service running locally on your computer, hence the named pipe issue.
  3. I've never used the eConnectMethods.RequireProxyService = false. I'm not sure what this does.
  4. I've often said that the level of documentation provided for GP development is almost criminally negligent. The information available is sparse at best and often describes simple, happy paths that don't lend themselves well to the real world. It's incredibly frustrating, especially if you are a contractor who is under billable-time constraints.
  5. SOP is one of the most complex transactions in GP. There are a LOT of eConnect nodes that do a LOT of different things.
  6. My understanding is that a locally installed and running eConnect Integration Service is absolutely necessary in order to use the eConnect DLLs.

The files you are attempting to load are the eConnect XML template files that describe the various eConnect transactions. The usual workflow is either:

  1. Manually create an eConnect transaction using the application. The XML is displayed in the eConnect XML box. You can then save it to a file and later re-load it.
  2. You are working with a pre-existing eConnect transaction's XML, such as the XML that another application has created, and you want to tweak it to test different options. You should be able to load the XML from the other application if it has been saved to a file.