/**
*
*/
package com.sample.betdaq;
import java.math.BigDecimal;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import com.globalbettingexchange.www.externalapi.BaseResponseSequence3;
import com.globalbettingexchange.www.externalapi.EventClassifierType;
import com.globalbettingexchange.www.externalapi.ExternalApiHeader;
import com.globalbettingexchange.www.externalapi.ExternalApiHeaderE;
import com.globalbettingexchange.www.externalapi.ListTopLevelEvents;
import com.globalbettingexchange.www.externalapi.ListTopLevelEventsRequest;
import com.globalbettingexchange.www.externalapi.ListTopLevelEventsResponse;
import com.globalbettingexchange.www.externalapi.ListTopLevelEventsResponseE;
/**
* @author albertop
*
*/
public class BetdaqClient {
public final static String epr = "http://api.betdaq.com/v2.0/API.wsdl";
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
ReadOnlyServiceStub clientStub = new
ReadOnlyServiceStub(epr);
ListTopLevelEvents list = new ListTopLevelEvents();
ListTopLevelEventsRequest eventsRequest = null;
list.setListTopLevelEventsRequest(eventsRequest);
ExternalApiHeaderE header = new ExternalApiHeaderE();
ExternalApiHeader apiHeader = new ExternalApiHeader();
String langCode="us-en";
apiHeader.setLanguageCode(langCode);
int theVersion = 1;
BigDecimal version = new BigDecimal(theVersion);
apiHeader.setVersion(version);
String username="test";
apiHeader.setUsername(username);
String password="test";
apiHeader.setPassword(password);
header.setExternalApiHeader(apiHeader);
ListTopLevelEventsResponseE response;
response = clientStub.ListTopLevelEvents(list, header);
ListTopLevelEventsResponse listTopLevelEventsResult =
response.getListTopLevelEventsResult();
BaseResponseSequence3[] baseResponseSequence =
listTopLevelEventsResult.getBaseResponseSequence();
int size = baseResponseSequence.length;
for (int i = 0; i<size; i++){
EventClassifierType classifier =
baseResponseSequence[i].getEventClassifiers();
System.out.println("Name is
"+classifier.getName()+" Id is "+
classifier.getId());
}
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
On Sun, Apr 6, 2008 at 9:15 PM, Jacques Poulin <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to figure out how to write a client application to connect to the
> Betdaq API (http://api.betdaq.com).
>
> The WSDL for the web services is here : http://api.betdaq.com/v2.0/API.wsdl
>
> I downloaded Axis (2.1.3), and launched the wsdl2java.bat script. I've
> tried different combinations of options to that command, but basically, I
> always wind up with 4 files :
>
> ReadOnlyServiceCallbackHandler.java
> ReadOnlyServiceStub.java
> SecureServiceCallbackHandler.java
> SecureServiceStub.java
>
> I'm sure that someone with a lot of experience with Axis could write a
> simple method that would use either of those stubs to make a call to the
> API.
>
> Any of Betdaq's methods would be fine... The ListTopLevelEvents seems
> simple enough...
>
> Once I've seen a sample, I'm sure I'll be fine... I just need some help to
> start.
>
> Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Don't be evil!!!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]