Jason,

If that's the case then I think you can use the technique described at

the bottom of

http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html (the

section "Explicit Method Specification") which should allow you to

choose the specific overloaded method to use.


i'm trying to implement the info you sent me but am having a bit of trouble with the syntax. The class in question reads as so:

public class CallerServices {


    /**
     * Initializes the API Caller 
     * @throws PayPalException 
    */
    public void initialize() throws PayPalException { 
    }

    /**

     * Invokes an API call from a request object

     * @param operationName name of web service to invoke

     * @param request request object

     * @return response object

     * @throws PayPalException if no profile is set, or an error occurs while executing the call

    */

    public AbstractResponseType call(String operationName, AbstractRequestType request) throws PayPalException { 
        if (caller == null) {
            this.initialize();

        } 
        return caller.call(operationName, request); 
    }

    

    /**

     * Invokes an API call from an XML request string (NOTE: Used only by the console) 
     * @param operationName name of web service to invoke 
     * @param requestStr request string

     * @return response string
     * @throws PayPalException

    */
    public String call(String operationName, String requestStr) throws PayPalException {

        AbstractRequestType request = (AbstractRequestType)XMLSerializer.fromXML(requestStr); 
        AbstractResponseType response = this.call(operationName, request);
 
        return XMLSerializer.toXML(response); 
    } 
}

The method I am after is:

 public AbstractResponseType call(String operationName, AbstractRequestType request) throws PayPalException

So I do the following in my flowscript:

importClass(Packages.com.paypal.sdk.services.CallerServices);
....
response = CallerServices["call(String, AbstractRequestType)"]; 
response(5);

I am now getting the following error message:

Java class "com.paypal.sdk.services.CallerServices" has no public instance field or method named "call(String, AbstractRequestType)".

What am I doing wrong here?

Andrew



Reply via email to