Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
New Member
Posts: 4
Registered: ‎03-19-2013
Accepted Solution

SLX WCF

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

Highlighted
Copper Super Contributor
Posts: 27
Registered: ‎06-23-2009

Re: SLX WCF

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.

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX WCF

... 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.

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
New Member
Posts: 4
Registered: ‎03-19-2013

Re: SLX WCF

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.

Highlighted
Copper Super Contributor
Posts: 27
Registered: ‎06-23-2009

Re: SLX WCF

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.

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX WCF

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. 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Highlighted
New Member
Posts: 4
Registered: ‎03-19-2013

Re: SLX WCF

"the standard function through the SalesLogix oledb provider to generate your ids."

can you be more specific or better yet give an example?
Highlighted
Copper Super Contributor
Posts: 27
Registered: ‎06-23-2009

Re: SLX WCF

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.

Highlighted
New Member
Posts: 4
Registered: ‎03-19-2013

Re: SLX WCF

Great!!! Thank you very much.. I will most likely accept this as a solution as soon as I get back to my machine and implement this. Is there a list of all procedures available using the OleDBConnection
Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: SLX WCF

It's all in the dev ref documents (help files). These things have been around for many years ;-)

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html