Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Magento XML-RPC API - Create Shipment from Java - Please delete this one
Jr. Member
Total Posts:  4
Joined:  2012-12-10


Im trying to create shipments for magento orders from my third party app using the XML-RPC API. Everything works great when i make the call to \\\"sales_order_shipment.create\\\" with just the order increment id, but if i try making the same call with both an order_id and a set of items and quantities, it will say \\\"Requested order not exists.\\\” Why is that? what im doing wrong? what type should be the itemQuantity object? Map? Array of objects?

heres my code

package magentoapiclient;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class 

public static void main(String[] args{

public static XmlRpcClient prepareClient() throws MalformedURLException {
        XmlRpcClientConfigImpl config 
= new XmlRpcClientConfigImpl();
config.setServerURL(new URL(\\\"myHost\\\"));
XmlRpcClient client = new XmlRpcClient();
client.setTypeFactory(new MyTypeFactory(client));

public static void createShipment(String orderIdint itemIddouble quantity{
try {
            XmlRpcClient client 
String sessionId login(\\\"myUser\\\"\\\"myKey\\\"client);
Object[] request {orderId, new HashMap()};
client.execute(\\\"call\\\", new Object[]{sessionId\\\"sales_order_shipment.create\\\"request});
catch (XmlRpcException MalformedURLException ex{

public static String login(String userString passwordXmlRpcClient clientthrows XmlRpcException {
        String sessionId 
= (String) client.execute(\\\"login\\\", new Object[]{userpassword});

public static void endSession(String sessionTokenXmlRpcClient clientthrows XmlRpcException {
.execute(\\\"endSession\\\", new Object[]{sessionToken});

As you see in the line

Object[] request = {orderId, new HashMap()};

i try sending a hashMap that actually should contain the order item id and quantity. Ive also tried sending an array of objects and it doesnt work for any of them. What sould be there insetead then if neither a Map or an Array is available?

Thank you for your help from advance

Sorry, it seems my topic got duplicated several times, please delete this one

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top