03-19-2013 11:20 AM
Hi
This is my first post to the community. I am creating a Web Service (.net WCF) that queries the SLX database. Everything works fine so far, however I have come across two issues.
First- authentication -- I need to be able to authenticate against the SLX database.
Second- generating new record IDS. I need to be able to insert records using this web service, and I don’t know how to go about generating new recordIDs.
I was told that when using .net I should be using the nhibernate framework with the Sage.Entity.Interfaces reference. Come someone point me in the right direction as to how to setup this environment and any thing I should consider when working on a project like this.
Thank you
Solved! Go to Solution.
03-25-2013 05:17 AM
Personally, I'm not sure why you'd want to re-invent the wheel. sData is a full RESTful service which provides access to not only your data but also conforms to all the business rules defined in the Entity model.
Even in those times where you really need something so complex it's not worth building into the entity framework we just have our custom WCF act as an sData client and provide exactly what we need still keeping things kosher with business rules and sync.
We use the sdata service all the time with great success.
Regards,
James.
03-25-2013 05:45 AM
... to add to James post.. there are javascript and C# SData client libraries up on gitgub that take a lot of the work out of using SData as well.
03-25-2013 10:48 AM
Thank you for your posts. It possible that it is just my setup, however I originally used the SData c# client wrapped in a WCF server to interface with the SLX database and it was a nightmare.
I will admit I have no prior experience with SLX and jumped into this project trying to fix a problem that my company has been struggling with for the past year or so.
What I mean by a nightmare, well, frankly the sdata server was unintuitive to interface with, payloads sent over way more information than necessary, so parsing the information was a pain, and it was slow as can be.
Again, I did this with no prior experience, so I may have been doing something wrong, in addition the servers were setup prior to me getting on the scene so it could have been a simple resource issue to fix the speed. However I did feel as though I was jumping through many needless hoops to get to the data, and this was setup by our Sage representatives, so I figured all was well.
Since then I took sage slx development training courses and realized I could just interface directly with the sql server. Since then I have been making great progress, and knew eventually I was going to run into some issues. All I really need to do at this point is generate keys for newly inserted records, and figure out how to use the library to encrypt and decrypt the passwords.
Again I admit my naiveness about this subject, however I don't see anything wrong with what I am doing. If there is, can you explain why, and if there isn't, can you help me.
03-25-2013 11:27 AM
Don't recommend it since your side stepping all the busness logic in the application but to generate ids I would recommend setting up an addtional SLXOLEDB connection and use the standard function through the SalesLogix oledb provider to generate your ids. You're going to have to watch out for a lot of things if you do all your data updates directly in SLX though (especially things like date/time fields).
James.
03-25-2013 12:28 PM
Agree w/James... and strongly suggest you go back to using SData.
Even though you took "development course(s)", you did not say just which one(s). There's a specific course on SData in the Master's series that gets you right where you should be in terms of building an app using the RESTful web services interface. In case you missed it, SData can return JSON (vrs the "XML mess") and is quite easy to work with.. and it's very FAST!
Oh yes, the SalesLogix Mobility Web App is SData based and
Invest a little in SData and it will be a big payback in the long run.
03-27-2013 05:26 AM
03-28-2013 07:16 AM
The Ole DB provider exposes a procedure to generate ids for you. I copied this code example in from SLXDeveloper.com
public string NewID(string table) { using (OleDbConnection conn = new OleDbConnection(SlxConnectionString)) { conn.Open(); using (OleDbCommand cmd = new OleDbCommand(string.Format("slx_dbids('{0}', 1)", table), conn)) { return cmd.ExecuteScalar().ToString(); } } }
Regards,
James.
03-28-2013 09:26 AM
03-28-2013 01:33 PM