API for the WebService

This forum is for programmers who have questions about the source code.
Post Reply
SCdF
Posts: 3
Joined: Mon May 17, 2010 5:36 pm

API for the WebService

Post by SCdF » Mon May 17, 2010 5:44 pm

Hi,

I have been looking at the webservice that is provided by OpenDental in an attempt to see if I wish my application to query it. Currently I have ascertained that the ws consists of one method that takes a string and returns a string.

Is there more API information than this? Such as what sorts of things can be sent in the request? I'm guessing that it's potentially just a pipe for SQL statements, I'm just not sure. One option is for me to put a proxy between the client and the server (over HTTP) and play around and watch what gets sent, but I'm wondering if it's documented anywhere?

Thanks,
Stefan

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: API for the WebService

Post by jordansparks » Mon May 17, 2010 6:33 pm

It's a pipe for everything BUT SQL statements. Accepting SQL would be far too dangerous. The "documentation" is the source code. A quick look at OpenDentalServer ServiceMain.asmx.cs

You would basically package the entire request into an object called a DataTransferObject (DTO). There are different kinds of DTO. Each DTO includes credentials, methodname, and parameters. The result back from the server can be an error, a simple type like an int or string, a DataTable, etc. All DTO's and all results are serialized. So you would have to serialize each DTO in exactly the same way that we do, and you would have to process the serialized result. That part is not very well documented and would involve testing.

This is not meant for casual interaction with outside programs. It's instead designed for someone who wants to build an entire interface as part of building a client version of Open Dental.
Jordan Sparks, DMD
http://www.opendental.com

SCdF
Posts: 3
Joined: Mon May 17, 2010 5:36 pm

Re: API for the WebService

Post by SCdF » Tue May 18, 2010 10:04 am

Thanks for your prompt reply.

So I checked out the source code and I see what you mean. One question, is there a reason the unmarshalling is done manually in your layer and not done by the WS framework that you use? If you let the WS framework do it then the WSDL and accompanying schema that is generated would have the XML definition of the possible DTOs in it, which would make custom development and integration with OpenDental easier, as it would give us a known XML schema to work off and against, and would reduce coupling between the client and the server.

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: API for the WebService

Post by jordansparks » Tue May 18, 2010 11:28 am

That just wasn't high on my priority list. Mostly lack of time. Yes, it would be nice to have 9 web methods instead of 1, but not really a big deal

Anyway, you might have the XML definition of the DTO's, but you would still need to be very careful about how you serialized each object within the DTO. I think it's more complicated than an XML schema could define.
Jordan Sparks, DMD
http://www.opendental.com

SCdF
Posts: 3
Joined: Mon May 17, 2010 5:36 pm

Re: API for the WebService

Post by SCdF » Tue May 18, 2010 3:08 pm

Cool, thanks for the clarification. You're right, it doesn't really make that much difference, it just threw me for a moment :-)

Post Reply