Hallo,
ich habe hier im Forum bereits vergebens nach einer Lösung für mein Problem gesucht.
Mein Ziel ist in Java die Verbindung zu meiner Bank (Postbank) herstellen und den Kontostand meines Kontos abfragen zu können.
Ich möchte die Verbindung via PinTan-Methode herstellen und die notwendigen Daten für den Passport direkt im Quellcode setzen. Dazu bin ich hier im Forum auch schon fündig geworden: hbci4java ohne passport.
Ich bin wie in dem Thread beschrieben vorgegangen. Allerdings bekomme ich beim Aufrufen der getInstance-Methode eine NullPointer-Exception. Durch Debuggen habe ich herausgefunden, dass die Klasse "HBCIPassportXYZ" nicht gefunden wurde.
Hat jemand Erfahrungen damit und weiß, warum die Kontostandsabfrage nicht funktioniert?
Nachfolgend der Quellcode:
package org.kapott.hbci.passport;
public class HBCIPassportXYZ extends HBCIPassportPinTan {
public HBCIPassportXYZ(Object init, int dummy) {
super(init);
}
public HBCIPassportXYZ(Object initObject) {
this(initObject, 0);
this.setHost("hbci.postbank.de/banking/hbci.do");
this.setHBCIVersion("HBCI+");
this.setFilterType("Base64");
this.setUserId("KontoNr.");
this.setPIN("PIN");
this.setBLZ("BLZ");
this.setPort(new Integer(443));
this.setProxy("");
this.setCountry("DE");
this.setCheckCert(false);
this.setProxyUser("");
this.setProxyPass("");
this.setCustomerId("KontoNr.");
}
public void saveChanges() {
// nichts mehr tun lassen
}
}
import org.kapott.hbci.GV.HBCIJob;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.passport.AbstractHBCIPassport;
import org.kapott.hbci.passport.HBCIPassport;
import org.kapott.hbci.status.HBCIExecStatus;
public class hbciTest {
/**
* @param args
*/
public static void main(String[] args) {
try {
HBCIPassport passport = AbstractHBCIPassport.getInstance("XYZ");
HBCIHandler handle = new HBCIHandler(passport.getHBCIVersion(),
passport);
HBCIJob jobSaldo = handle.newJob("SaldoReq");
jobSaldo.setParam("number", "KontoNr.");
jobSaldo.addToQueue();
HBCIExecStatus status = handle.execute();
handle.close();
} catch (final NullPointerException e) {
e.printStackTrace();
}
}
}
Vorab schon mal Danke für jede Art der Hilfe!
Gruß
maps
ich habe hier im Forum bereits vergebens nach einer Lösung für mein Problem gesucht.
Mein Ziel ist in Java die Verbindung zu meiner Bank (Postbank) herstellen und den Kontostand meines Kontos abfragen zu können.
Ich möchte die Verbindung via PinTan-Methode herstellen und die notwendigen Daten für den Passport direkt im Quellcode setzen. Dazu bin ich hier im Forum auch schon fündig geworden: hbci4java ohne passport.
Ich bin wie in dem Thread beschrieben vorgegangen. Allerdings bekomme ich beim Aufrufen der getInstance-Methode eine NullPointer-Exception. Durch Debuggen habe ich herausgefunden, dass die Klasse "HBCIPassportXYZ" nicht gefunden wurde.
Hat jemand Erfahrungen damit und weiß, warum die Kontostandsabfrage nicht funktioniert?
Nachfolgend der Quellcode:
Code
package org.kapott.hbci.passport;
public class HBCIPassportXYZ extends HBCIPassportPinTan {
public HBCIPassportXYZ(Object init, int dummy) {
super(init);
}
public HBCIPassportXYZ(Object initObject) {
this(initObject, 0);
this.setHost("hbci.postbank.de/banking/hbci.do");
this.setHBCIVersion("HBCI+");
this.setFilterType("Base64");
this.setUserId("KontoNr.");
this.setPIN("PIN");
this.setBLZ("BLZ");
this.setPort(new Integer(443));
this.setProxy("");
this.setCountry("DE");
this.setCheckCert(false);
this.setProxyUser("");
this.setProxyPass("");
this.setCustomerId("KontoNr.");
}
public void saveChanges() {
// nichts mehr tun lassen
}
}
Code
import org.kapott.hbci.GV.HBCIJob;
import org.kapott.hbci.manager.HBCIHandler;
import org.kapott.hbci.passport.AbstractHBCIPassport;
import org.kapott.hbci.passport.HBCIPassport;
import org.kapott.hbci.status.HBCIExecStatus;
public class hbciTest {
/**
* @param args
*/
public static void main(String[] args) {
try {
HBCIPassport passport = AbstractHBCIPassport.getInstance("XYZ");
HBCIHandler handle = new HBCIHandler(passport.getHBCIVersion(),
passport);
HBCIJob jobSaldo = handle.newJob("SaldoReq");
jobSaldo.setParam("number", "KontoNr.");
jobSaldo.addToQueue();
HBCIExecStatus status = handle.execute();
handle.close();
} catch (final NullPointerException e) {
e.printStackTrace();
}
}
}
Vorab schon mal Danke für jede Art der Hilfe!
Gruß
maps