Battling eBay with java – java.lang.IllegalStateException

During my explorations of the [eBay Java SDK]( which uses [Apache Axis]( to access [eBay](’s [SOAP]( interface I stumbled over the following fine piece of bad bad bad code:

public static BuyerPaymentMethodCodeType fromString(String value)
throws java.lang.IllegalStateException {
try {
return fromValue(new org.apache.axis.types.Token(value));
} catch (Exception e) {
throw new java.lang.IllegalStateException();

Why is it bad? Because the IllegalStateException which is thrown does not contain any pointer to the cause of the exception. In my case eBay was returning a PaymentTypeCode which is not valid according to the published wsdl. It took my 1 day and a download of the axis source tarball to catch this one. I want to note that the code mentioned has been generated by axis’ wsdl2java from the wsdl published by ebay. I will have to dig a little deeper.


{ Comments are closed! }