No deserializer for CartItemMultimedia - SOAP Checkout API Errors
Error:
[15-Jun-2011 10:08:36] PHP Fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] org.xml.sax.SAXException: No deserializer for {http:// objects.checkoutapi.ultracart.bpsinfo.com}CartItemMultimedia
Commonly caused by this code:
$cartItems = $client->getItems($merchantId, $itemIds); $response = $client->updateItems($merchantId, $cart, $cartItems);
Issue:
getItems()
returns back Item objects.
updateItems()
wants CartItem objects.
Item and CartItem are very different objects, and SOAP is very particular. With a typeless language like PHP, the difference isn't detectable form a cursory glance. With a language like Java, a compile-time error would result.
Please see: CartItem and Item to understand the why UltraCart provides two different objects.
The Cart
object (returned from getCart()
) contains an array of items in the cart. Use that property if you wish to get a list of items to pass to updateItems()
, or just construct your own object.