Question

I'm finding this incredibly frustrating. I'm trying to use the InventoryFacadeClient to call either the Change or Sync web services to update product availability. The issue I'm facing is that I can't seem to instantiate all of the required DataTypes to populate the request.

It's quite confusing, I wanted to call ChangeInventory but can't compose the request, and started down SyncProductAvailability but again, can't compose the request.

The problem below is that the ProductIdentifierType is null, and there's no corresponding "createProductIdentifierType" on the Factory....I'm not sure what I"m missing here, the factory seems to be half baked...

If someone can help me complete this code, it would be great?

public void setUp() throws Exception {
        String METHOD_NAME = "setUp";
        logger.info("{} entering", METHOD_NAME);
        super.setUp();

        InventoryFacadeClient iClient = super.initializeInventoryClient(false);

        InventoryFactory f = com.ibm.commerce.inventory.datatypes.InventoryFactory.eINSTANCE;
        com.ibm.commerce.inventory.facade.datatypes.InventoryFactory cf = iClient.getInventoryFactory();
        CommerceFoundationFactory fd = iClient.getCommerceFoundationFactory();



        // we must have customised the SyncProductAvailability web service to 
        // handle ATP inventory model.

        SyncProductAvailabilityDataAreaType dataArea = f.createSyncProductAvailabilityDataAreaType();
        SyncProductAvailabilityType sat = f.createSyncProductAvailabilityType();
        sat.setDataArea(dataArea);
        DocumentRoot root = cf.createDocumentRoot();
        sat.setVersionID(root.getInventoryAvailabilityBODVersion());

        ProductAvailabilityType pat = f.createProductAvailabilityType();
        ProductIdentifierType pid = pat.getProductIdentifier();
Was it helpful?

Solution

I found the answer to this on another forum. I was missing the right CommerceFoundationFactory - the class the ProductIdentifierType is created from is:

com.ibm.commerce.foundation.datatypes.CommerceFoundationFactory fd2 = com.ibm.commerce.foundation.datatypes.CommerceFoundationFactory.eINSTANCE;

fd2.createProductIdentifierType

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top