A webservice running under MONO
MotionSOAP is a WebService that runs under Mono. It is rather a primative phase at the moment. I plan to work this interface to include all of the html control functionality along with more analytical functions. Today it is quite a useful interface as can be seen from the simple Windows Consumer application that is packaged along with the Soap interface. More on that later
The SOAP Interface
Essentially this interface allows you to determine how many frames/events exist on your motion server, to retrieve those stored frames remotely and to delete them if you no longer require them
An Example Windows Consumer
Although a simple program it shows how the SOAP interface can be put to good use. Your mileage may very especially on low bandwidth connections. However the application allows you
- Drill down into any month day or hour of any camera
- Shows you all the frames/events that exist for a camera/period.
- Preview those frames
- Assemble them into an avi file locally on your PC
- Delete those frames from the moton server.
- Save single frames as JPEG's to your PC locally
There are 4 files in the zip
- MotionService.asmx (the WEBSERVICE Source code)
- Web.config (The configuration file for the webservice)
- ConsumeService.exe (an example windows program to consume the service)
- ConsumeService.exe.config (The config file for Consume service)
Installation of the WebService
To install the Webservice you will need a working copy of MONO http://www.mono-project.com/Main_Page
running on the same platform as Motion.
You will need the ByteFX.Data provider which is usually shipped with MONO.
A working copy of MySQL
Copy the files to the area where you are going to serve the MONO content for example
You will need to place the ByteFX.MySqlClient.dll in the bin directory (in this example )
Edit the Web.config file
There are three parameters of interest. Much of the rest is used for debugging or general DOTNET
configuration. The Section of most interest to you will be within the <appSettings/>
This is where you provide the mysql connection parameters and takes the form
Database=databaseName;Data Source=theHostMachine;User Id=databaseUserID;Password=databasePassword
This is a name of a user allowed to invoke the methods of the webservice
This is the password of the user allowed to invoke the methods of the webservice
Once you have modified the settings to your preferences. You should be able to test to see if all is well with the webservice by typing the URL to where you placed it for instance http://localhost/motion/MotionService.asmx
If all is well you will see an overview screen similar to above
Installation of the Client Consumer Software
Copy the files to an area on your windows PC
Edit the file ConsumeService.exe.config
There are three parameters of interest. The Section of most interest to you will be within the <appSettings/>
This is where the WebService resides for example http://192.168.0.1/motion/MotionService.asmx
This must correspond with the user setting in the webservice configuration for this program to work
This must correspond with the password setting in the webservice configuration for this program to work
Other options of interest are
This option states the base time code for the AVI files created.
This option states the height of the AVI file created and must match the height of your captured images
This option states the width of the AVI file created and must match the width of your captured images
This option states the compression type to use. Valid values are mpeg4, xvid, divx NOTE
you must have a valid codec installed that matches the option otherwise the software will more than likely crash. If in doubt go with mpeg4 as this codec is available on most MS machines
Save the file
If all is well you will see a summary of all pictures that have been captured for this year month by month.
Clicking on any Month item will show you a summary for each day in the month for that camera.
Clicking on any Day will show you a summary for each hour.
Right click any of the lists to see what further options/actions are available
If you see an error stating Error Contacting the webservice The Root Element is missing
check that the username and passwords match on the client and server configs.
Kenneth came by and gave a hand with the formatting.
Especially note that ! in front of a !WikiWord prevents unwanted linking.
You always need a blank line to get a paragraph mark. A single new line does not show at all. This is needed to enable compatibility with using HTML. You can make a HTML <BR> either by using the HTML <BR> or the TWiki variable %BR%.
Bullet points using "space space space * space" is a wonderful simple way to make clear listings of for example files.
Great project. Nice to see initives like this.
- 14 May 2005
Thank you Kenneth
- 16 May 2005