Search code examples
phppythonodoo-8xml-rpc

Python - XML not well-formed (invalid token) Debug Values


I'm getting this error when I try to import some of the saleorders, I need to debug the values of the return statement but i'm not getting anything but errors. The code is working for the majority of the saleorders but i get in the error on a couple of orders and i can't identify the error.

I try with print_r() and var_dump() but is not working.

Python is returning the error "ValueError: "not well-formed (invalid token)".

Thanks.

$saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),
                "price_type" => new xmlrpcval( clean_special_chars($price_type), "string" ),
                "note" => new xmlrpcval(clean_special_chars($note), "string" ),
                "lines" => new xmlrpcval( $orderlines, "array"),
                "pay_met" => new xmlrpcval( search_payment_method($row[24]), "int"),
                "pay_met_title" => new xmlrpcval( clean_special_chars($row[24]), "string"),
                "shipping_price" => new xmlrpcval( $shopping_price, "double"),
                "shipping_title" => new xmlrpcval(html_entity_decode(clean_special_chars($shipping_title)), "string"),
                "orders_status" => new xmlrpcval( clean_special_chars($status), "string"),
                "partner" => $partner,
                "date" => new xmlrpcval( $row[21], "string"),
                "address" => $default_address,
                "delivery" => $delivery_address,
                "billing" => $billing_address,
                "order_subtotal" => new xmlrpcval($order_subtotal, "double"),
                "order_tax" => new xmlrpcval($order_tax, "double"),
                "order_total" => new xmlrpcval($order_total, "double"),
            ), "struct");

return new xmlrpcresp(new xmlrpcval($saleorders, "array"));

Solution

  • Try with the method serialize of the xmlrpcval to see the values Link: https://gggeek.github.io/jsxmlrpc/javadoc/xmlrpcval.html#serialize