FileDocCategorySizeDatePackage
TestCall.javaAPI DocApache Axis 1.42373Sat Apr 22 18:57:26 BST 2006test.client

TestCall

public class TestCall extends TestCase

Fields Summary
Constructors Summary
public TestCall(String name)

        super(name);
    
Methods Summary
protected voidsetup()

    
public static junit.framework.Testsuite()

        return new TestSuite(TestCall.class);
    
public voidtestWeatherService()

        try {
            Call call = new Call(new URL("http://live.capescience.com:80/ccx/GlobalWeather"));
            call.setUseSOAPAction(true);
            call.setSOAPActionURI("capeconnect:GlobalWeather:StationInfo#listCountries");
            call.setTimeout(new Integer(15*1000));
            call.setOperationName(new javax.xml.namespace.QName("capeconnect:GlobalWeather:StationInfo", "listCountries"));
            String[] c = (String[]) call.invoke(new Object[]{});
            System.out.println(c.length);
            for (int i = 0; i < c.length; i++) {
                System.out.println(c[i]);
            }
        }  catch (AxisFault fault) {
            if (fault.detail instanceof ConnectException ||
                    fault.detail instanceof InterruptedIOException ||
                    (fault.getFaultString().indexOf("Connection timed out") != -1) ||
                    fault.getFaultCode().getLocalPart().equals("HTTP")) {
                System.err.println("getTemp HTTP error: " + fault);
                return;
            }
            throw fault;
        }