We have been looking at vaCentral for quite sometime and finally opened an account and setup our VA.
On the home page of vaCentral it says “you can implement your code to talk to vaCentral through XML.”
When registering, there was a link to a user guide, but it was a dead link and we have a couple of questions:
As we are not using phpVMS, but another automated system our pilots use for sending flight reports (currently FSAcars, but will be updating to our own inhouse system later this year), where do we need to place the XML code?
We do not have fixed routes. We have what is called a Free Flying Policy where pilots can fly any route that they like. How will this affect our ranking within vaCentral?
We did search all the pages on the web site to try and find some documentation regarding all this, but didn’t seem to find much.
We have been looking at vaCentral for quite sometime and finally opened an account and setup our VA.
On the home page of vaCentral it says “you can implement your code to talk to vaCentral through XML.”
When registering, there was a link to a user guide, but it was a dead link and we have a couple of questions:
As we are not using phpVMS, but another automated system our pilots use for sending flight reports (currently FSAcars, but will be updating to our own inhouse system later this year), where do we need to place the XML code?
We do not have fixed routes. We have what is called a Free Flying Policy where pilots can fly any route that they like. How will this affect our ranking within vaCentral?
We did search all the pages on the web site to try and find some documentation regarding all this, but didn’t seem to find much.
Any assistance would be appreciated.
Thanks in advance,
-hello sir i think you will need this info
there you can download e nxml for your site to work with vacentral.
-this won’t affect your rating to mush i belive for the moment the majority is calculated on flying hous/pireps.
So if we understand this correctly. In our case, we would just need to trigger the update_vainfo to send our total pilot count, total hours, total fights, etc. to send that data to vaCentral up to 3 times a day? Are these totals for the day or total to date?
As we don’t have any fixed routes, we do not need to use the update_schedules?
What is the Receive URL that I need to send this data to?
Sorry for all the questions, but as there doesn’t seem to be any documentation available, we need to rely on your knowledge.
So if we understand this correctly. In our case, we would just need to trigger the update_vainfo to send our total pilot count, total hours, total fights, etc. to send that data to vaCentral up to 3 times a day? Are these totals for the day or total to date?
As we don’t have any fixed routes, we do not need to use the update_schedules?
What is the Receive URL that I need to send this data to?
Sorry for all the questions, but as there doesn’t seem to be any documentation available, we need to rely on your knowledge.
If you look at the PHP file on that page, it’s a little clearer. And it would be overall totals, to date. You have to fill int he parameters, it’s in the documentation in the PHP file.
We need a little more information on how vaCentral receives this information.
The home page of va Central says “or if you’re using a custom system, you can implement your code to talk to vaCentral through XML.”
Does this mean the xml should be placed on our home page and vaCentral will query it once a week or do we need to send this information via an http query string or when visiting the api site and populate the web page with the XML file in order for vaCentral to read it?
Our web site is written in asp.net and not php therefore I need to understand the process, so that we can write the code accordingly.
A huge chunk of the XML docs are missing.. let me find them
And the time you send them it up to you… a cron job or integrated into your existing system. For instance, I’d send VA info every 3/4 hours and schedule updates once a day (2am or something), and send pirep info updates every time a PIREP comes in
How you want to trigger the event is up to you. We simply created a page with a Send Stats button that we will use to send the updated stats, a couple times a day.
At the top of your page, you will to define the following imports:
Imports System
Imports System.IO
Imports System.Net
Imports System.Text
In the sub that triggers the Send Stats event whether it be a button.click or whatever else:
' Stats that you need to retreive from your database and populate into these variables.
Dim stringTotalHours as integer 'Total VA hours.
Dim stringTotalFlights as integer 'Total VA flights.
Dim stringTotalPilots As integer 'Total VA pilots.
' Create a request using a URL that can receive a post.
Dim SendVAStats As WebRequest = WebRequest.Create("http://api.vacentral.net/update")
SendVAStats.Proxy = WebRequest.GetSystemWebProxy()
SendVAStats.Proxy.Credentials = CredentialCache.DefaultCredentials
' Set the Method property of the request to POST.
SendVAStats.Method = "POST"
' Create POST data and convert it to a byte array.
Dim stringVAStats As String = "<?xml version=""1.0""?> <vacentral> <siteurl>Your VA URL</siteurl> <apikey>Your API Key</apikey> <version> </version> <debug> </debug> <method>update_vainfo</method> <pilotcount>" & stringTotalPilots & "</pilotcount> <totalhours>" & stringTotalHours & "</totalhours> <totalflights>" & stringTotalFlights & "</totalflights> <totalschedules> </totalschedules> <expenses>0</expenses> <expensescost> </expensescost> <livefuel>0</livefuel> </vacentral>"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(stringVAStats)
' Set the ContentType property of the WebRequest.
SendVAStats.ContentType = "text/xml"
' Set the ContentLength property of the WebRequest.
SendVAStats.ContentLength = byteArray.Length
' Get the request stream.
Dim dataStream As Stream = SendVAStats.GetRequestStream()
' Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length)
' Close the Stream object.
dataStream.Close()
' Get the response.
Dim response As WebResponse = SendVAStats.GetResponse()
' Display the status.
Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
' Get the stream containing content returned by the server.
dataStream = response.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New StreamReader(dataStream)
' Read the content.
Dim responseFromServer As String = reader.ReadToEnd()
' Display status in a label that is on your aspx page.
LabelSendStatsStatus.Visible = True
LabelSendStatsStatus.Text = (responseFromServer)
' Clean up the streams.
reader.Close()
dataStream.Close()
response.Close()
Hopefully, this will be of assistance to someone out there.