FleetManagerApi sample C# client
Adding a reference to the webservice (the GUI way, Visual Studio 2008)
- Right click on your client project and select "Add servce reference"
- On this dialog select "Advanced..." and then on the new dialog select "Add Web Reference..."
(for .net 2.0 Web Services Technology)
- In the "Add Web Reference" dialog type in the URL, specify the namespace you want
to use in the "Web reference name" editbox and click "Add reference".
- If all was successful the web reference should appear in the web references folder
of your client project.
Adding a reference to the webservice (the command-line way, tested on Visual Studio
2008)
To perform the same from a command line tool you'll need to use disco.exe and then
wsdl.exe. Below is an XML snippet and a batch script that seems to do the job, but
this method was not very exhaustively tested by us.
Save this xml into a file called wsdlparams.xml
<wsdlParameters xmlns="http://microsoft.com/webReference/">
<nologo>true</nologo>
<parsableerrors>true</parsableerrors>
<language>CS</language>
<namespace>bluetree.fmapi</namespace>
<documents>
<document>FleetManagerAPI.wsdl</document>
</documents>
</wsdlParameters>
Then after adjusting the values of the variables execute the following commands
from cmd.exe (or paste them into a bat file and execute the bat file):
set ServiceUrl=https://api.fleetmanager.com/FMAPIService/FleetManagerAPI.asmx
set FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
"%FrameworkSDKDir%\bin\disco.exe" %ServiceUrl%
"%FrameworkSDKDir%\bin\wsdl.exe" /par:wsdlparams.xml
This will generate a file called FleetManagerAPI.cs, this file contains the web-service
proxy code. Add this file to your project and you can use the bluetree.fmapi namespace
as if you had generated the proxy code via the GUI way.
Sample code
The app.config file for the SampleClient application contains the address of the webservice where
the SampleClient connects to.
You can download the SampleClient application from here:
Sample application