Why do I have to set PasswordOption.SendPlainText – isn’t this insecure?

BETDAQ stores a one-way hash of your password in it’s database: we have no idea what your original password is. The only way we can be sure you are who you say you are, is if we compare something you send us with what we have in the database. We could ask you to hash your password and send it to us and we would compare _those_ values, but then you would need to know the hashing-algorithm that we used – which would be a pain for you, as our hashing algorithm is non-standard, and would require custom code on your part.

By sending your password to us, we hash it with our algorithm and compare it to the value in the database. This is actually what happens on the main betdaq.com website – the password is submitted as plaintext over SSL, and hashed on the server before comparison.

What makes the whole process secure, is the fact that all the secure methods are protected by SSL (as with the website) – so even sending the password in plaintext is secured from “prying eyes”.

Can you supply me with [.Net|Java] proxy files?

At the moment, we do not intend to supply anything more than the WSDL files. Generating proxy classes for your .Net clients is easy. We will try to post a Java example soon, but in the meantime you may want to investigate the Apache Axis project. This project contains a WSDL2Java converter which can generate Java proxies. We will update this page when we get more information.

When updating a bet on the server, why is the submitted amount treated as a delta (difference) and not an absolute value?

Imagine that you have a bet on the server that is for $1000 at 2.3. You would like to change this to $800, as you believe your exposure is too great. We have the following scenarios:

  1. Update bets works with deltas: You believe that the bet is for $1000. However someone (unknown to you) matches the bet for $500 You indicate that you wish to reduce the bet by $200. The final unmatched amount is $300(1000 – 500 – 200) and you have freed up $200 of your money
  2. Update bets works with absolute amounts: You believe that the bet is for $1000. However someone (unknown to you) matches the bet for $500 (unmatched is now $500). You indicate that you wish the bet to be $800 ($300 must be added). The final unmatched amount is $800, but this has tied up another $300 of your money.

As you can see, the worst case scenario for 2) is much worse than for 1).

Does it matter if my PC is running a different time to the exchange?

Yes. You need to ensure your PC is synchronised to the world clock or other. BETDAQ cannot process requests that are in the past. You should enable windows to “Automatically Synchronize with an Internet time server” in the Date and Time applet in the control panel. BETDAQ is synchronized with time.windows.com so if you do this then it should be fine.

I am using Java to build an automated tool. I am getting compilation errors when I compile with Apache Axis (using 1.1 and 1.2 rc3)?

Compiling with Sun Java Web Services Developer Pack 1.5 should resolve this issue.

Is there a way of determining whether a market will go in-running?

Yes. When you call GetMarketDetail you will get one of the three responses below, which have the following meaning:

<IsInRunning>false</IsInRunning> – Will be in Running<IsInRunning>true</IsInRunning> – Is Currently In Running<IsInRunning/> – Will not turn In Running

How do I calculate Layers Liability on Each Way markets?

GetEventSubTreeNoSelections, GetEventSubTreeWithSelection, GetMarketInformation and GetPrices will return the PlacePayout which is the proportion of the payout that is to be paid on the place part of an order on an each-way market. Will only be present if the MarketType is one of EachWayNonHandicap, EachWayHandicap or EachWayTournament.

In order to calculate the layers liability on an order in an Each Way market (returned by ListBootstrapOrders, ListOrdersChangedSince, GetOrderDetails or PlaceOrderWitReceipt), perform the following calculation using the MatchedAgainstStake and the PlacePayout

Layers Liability = (MatchedAgainstStake/2)+((MatchedAgainstStake/2)*PlacePayout)

How do I access the API via VB.Net?

The following information describes calling the BETDAQ API in VB.Net using Visual Studio 2005.

Begin by adding a web reference to the BETDAQ API. Go to the Project menu, select Add Web Reference. When the Add Web Reference dialog appears, enter the BETDAQ API WSDL URL into the URL field. Click onGo. In the Web reference name: field enter your preferred reference name (in this example BETDAQ API). Click on Add Reference. This will create the local proxy classes for accessing the BETDAQ API in your project.

Read Only Web Method Sample Code

' Create the read only service object
Dim readOnlyService As New BETDAQ API.ReadOnlyService

‘ Create and set the values in the ExternalApiHeader
Dim externalAPIHeader As New BETDAQ API.ExternalApiHeader

externalAPIHeader.username = “apiautotestsuser” ‘ Set Username
externalAPIHeader.password = “” ‘ Set Password
externalAPIHeader.version = 2 ‘ Set Version
externalAPIHeader.languageCode = “en” ‘ Set Language

readOnlyService.ExternalApiHeaderValue = externalAPIHeader

‘ Create the request object
Dim listTopLevelEventsRequest As New BETDAQ API.ListTopLevelEventsRequest

‘ Create the response object
Dim listTopLevelEventsResponse As BETDAQ API.ListTopLevelEventsResponse

‘ Call the method
listTopLevelEventsResponse = readOnlyService.ListTopLevelEvents(listTopLevelEventsRequest)

txtEventSubTreeNoSelections.Text = String.Empty

‘ Loop through the EventClassifiers returned in the response object
For Each eventClassifier As BETDAQ API.EventClassifierType In listTopLevelEventsResponse.EventClassifiers

txtEventSubTreeNoSelections.Text += “ID: ” + eventClassifier.Id.ToString() + vbCrLf
txtEventSubTreeNoSelections.Text += “Name: ” + eventClassifier.Name + vbCrLf
txtEventSubTreeNoSelections.Text += “DisplayOrder: ” + eventClassifier.DisplayOrder.ToString() + vbCrLf
txtEventSubTreeNoSelections.Text += “IsEnabledForMultiples: ” + eventClassifier.IsEnabledForMultiples.ToString() + vbCrLf + vbCrLf

Next

Secure Service Web Method Sample Code

' Create the secure service object
Dim secureService As New BETDAQ API.SecureService

‘ Create and set the values in the ExternalApiHeader
Dim externalAPIHeader As New BETDAQ API.ExternalApiHeader

externalAPIHeader.username = “myusername” ‘ Set Username
externalAPIHeader.password = “mypassword” ‘ Set Password
externalAPIHeader.version = 2 ‘ Set Version
externalAPIHeader.languageCode = “en” ‘ Set Language

secureService.ExternalApiHeaderValue = externalAPIHeader

‘ Create the request object
Dim getAccountBalanceRequest As New BETDAQ API.GetAccountBalancesRequest
‘ Create the response object
Dim getAccountBalanceResponse As BETDAQ API.GetAccountBalancesResponse

‘ Call the method
getAccountBalanceResponse = secureService.GetAccountBalances(getAccountBalanceRequest)

‘ Use the value returned by the method in the response object
txtBalance.Text = getAccountBalanceResponse.Balance.ToString()

What should SOAP Request & Response look like?

This is a SOAP XML sample of a method call and the response. It is intended for people that need to construct their SOAP xml by hand, in the case of some non .NET clients that can’t find a way to make a proxy from the WSDL.

This is the request SOAP for GetPrices:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<ExternalApiHeader version="2" languageCode="en" username="username" password="xxx" xmlns="http://www.GlobalBettingExchange.com/ExternalAPI/" />
</soap:Header>
<soap:Body>
<GetPrices xmlns="http://www.GlobalBettingExchange.com/ExternalAPI/">
<getPricesRequest ThresholdAmount="0" NumberForPricesRequired="-1" NumberAgainstPricesRequired="-1">
<MarketIds>483492
</MarketIds>
</getPricesRequest>
</GetPrices>
</soap:Body>
</soap:Envelope>
Note that getPricesRequest is specified in lowercase as the wsdl specifies it.

This is the response SOAP for GetPrices :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
<soap:Header>
<wsa:Action>http://www.GlobalBettingExchange.com/ExternalAPI/GetPricesResponse
</wsa:Action>
<wsa:MessageID>uuid:3e024f83-fd7c-4720-a5c5-d26867782ae1
</wsa:MessageID>
<wsa:RelatesTo>uuid:4ed833ad-cf66-4d95-a23a-9d3540b9bab1
</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous
</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-f1a8ea97-1959-40eb-a911-e8b92058da76">
<wsu:Created>2006-12-04T13:24:08Z
</wsu:Created>
<wsu:Expires>2006-12-04T13:29:08Z
</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<GetPricesResponse xmlns="http://www.GlobalBettingExchange.com/ExternalAPI/">
<GetPricesResult>
<ReturnStatus Code="0" Description="Success" CallId="414d211a-6188-4432-b209-895afdb149db" />
</GetPricesResult>
</GetPricesResponse>
</soap:Body>
</soap:Envelope>