Change to signature for InvoiceService.createBlankOrder

Feb 28, 2013 at 6:25 PM
I recently got the latest version of the ISDotNet source code. It's good stuff. But I'm having a problem with the InvoiceService.createBlankOrder method.

The OLD signature was like this:
[XmlRpcMethod("InvoiceService.createBlankOrder")]
    Int32 isCreateBlankOrder(string key, int contactId, string description, DateTime orderDate, int leadAffiliateId, int saleAffiliateId);
and the new signature is like this:

[XmlRpcMethod("InvoiceService.createBlankOrder")]
    int isCreateBlankOrder(string key, int contactId, string description, string orderDate, int leadAffiliateId, int saleAffiliateId);
(See the orderDate changing from a DateTime to a string?)

Now the method throws the following error when used:

CookComputing.XmlRpc.XmlRpcFaultException: Server returned a fault exception: [0] No method matching arguments: java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer

I see in the new interfaces that there aren't ANY DateTime types any more. Instead you do some formatting via isdnExtensions.infuDate(orderDate) but I don't think that the Invoke() is finding the right method because it's seeing it as a string instead of a date time. infuDate() as written returns the date in the format "yyy-MM-dd hh:mm:ss" but the PHP API seems to format the date into the format "YYYYMMDDTHH:MM:SS". Perhaps that's the issue, it's not recognizing the string as a date and accepting it.

Any suggestions?
Jan 17, 2014 at 4:31 AM
Hi cchubb,

I've the exact issue and have tried almost all the possible way and still didn't find any solution? How did you fix?

Thank you
Jan 17, 2014 at 6:38 PM
Edited Jan 17, 2014 at 6:43 PM
I changed the signature used in the library to match what's expected by the service.

Change in InfusionSoftDotNet.cs:
    #region InvoiceService
    [XmlRpcMethod("InvoiceService.createBlankOrder")]
    int isCreateBlankOrder(string key, int contactId, string description, DateTime orderDate, int leadAffiliateId, int saleAffiliateId);
(That changes the type to DateTime to match what the service wants. Then you have to call it with a DateTime in isdnAPI.cs like this:
    newOrderNumber = api.isCreateBlankOrder(_ApiKey, contactId, description, Convert.ToDateTime(orderDate), leadAffiliate, saleAffiliate);
That's pretty much all I had to do. I'm no longer working on this project, so I might be behind the times, but that got me up and running.