/**
* Diese Klasse zeigt den Zugriff auf die Konto-Prüfung mit Java (AXIS Toolkit 1.1).
*
* @author Jan Willamowius
* @version 1.0
*/
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestClient {
final static int KONTO_OK = 0;
final static int BLZ_FORMAT = 1;
final static int BLZ_UNBEKANNT = 2;
final static int KONTO_PRUEFZIFFER = 3;
final static int KONTO_FORMAT = 4;
final static int NOT_IMPLEMENTED = 5;
final static int SOAP_ERROR = 99;
public static void main(String[] args) {
int ret = kontocheck("IHR-ACCESS-TOKEN", "0000198262", "20690500");
System.out.println("Resultat der Kontoprüfung: " + ret);
if (ret != KONTO_OK) {
// take action
}
}
// diese Methode können Sie in Ihre Programme übernehmen
public static int kontocheck(String token, String konto, String blz) {
try {
String endpoint = "http://blz-java.html:/soap";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("urn:/KontoCheck", "check"));
call.addParameter("token", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("konto", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("blz", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_INT);
Integer ret = (Integer) call.invoke(new Object[]{token, konto, blz});
return ret.intValue();
} catch (Exception e) {
System.err.println(e.toString());
return SOAP_ERROR;
}
}
}
|