Can't submit multiple products in a single request to ChangeCatalogEntry web service (Websphere Commerce)

StackOverflow https://stackoverflow.com/questions/17214207

  •  01-06-2022
  •  | 
  •  

Question

Using Websphere Commerce V7, FP6, FEP5.
I am attempting to do an update to our catalog using the ChangeCatalogEntry web service. I am able to update a single product just fine. My problem is that any additional CatalogEntry nodes are completely ignored. It appears to process only the first CatalogEntry node it finds. I am using SoapUI to submit the requests. Here is a sample that I am attempting to submit. In this example part number p_MAT153 is updated but p_MAT203 and p_MAT185 are not. Is the webservice designed to only update a single product per message?

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <soapenv:Header>
        <wsse:Security soapenv:mustUnderstand="1">
            <wsse:UsernameToken>
                <wsse:Username>
                    wcs_sonic
                </wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
                    passw0rd
                </wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
<ChangeCatalogEntry xmlns:udt="http://www.openapplications.org/oagis/9/unqualifieddatatypes/1.1"
                    xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                    xmlns="http://www.ibm.com/xmlns/prod/commerce/9/catalog"
                    xmlns:oa="http://www.openapplications.org/oagis/9"
                    xmlns:clmIANAMIMEMediaTypes="http://www.openapplications.org/oagis/9/IANAMIMEMediaTypes:2003"
                    xmlns:oacl="http://www.openapplications.org/oagis/9/codelists"
                    xmlns:clm54217="http://www.openapplications.org/oagis/9/currencycode/54217:2001"
                    xmlns:clm5639="http://www.openapplications.org/oagis/9/languagecode/5639:1988"
                    xmlns:qdt="http://www.openapplications.org/oagis/9/qualifieddatatypes/1.1"
                    xmlns:clm66411="http://www.openapplications.org/oagis/9/unitcode/66411:2001"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/9/catalog C:/Users/SteveS/MuleStudio/workspace/shapeitdeltaupdates/src/main/resources/WebContent/component-services/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ChangeCatalogEntry.xsd"
                    releaseID="9.0"
                    versionID="7.0.0.0">
   <oa:ApplicationArea xsi:type="_wcf:ApplicationAreaType">
      <oa:CreationDateTime>2013-04-29T15:38:19.173-04:00</oa:CreationDateTime>
      <_wcf:BusinessContext>
         <_wcf:ContextData name="storeId">10651</_wcf:ContextData>
         <_wcf:ContextData name="catalogId">10051</_wcf:ContextData>
      </_wcf:BusinessContext>
   </oa:ApplicationArea>
   <DataArea>
      <oa:Change>
         <oa:ActionCriteria>
            <oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[1]/Description[1]</oa:ActionExpression>
         </oa:ActionCriteria>
      </oa:Change>
      <CatalogEntry>
         <CatalogEntryIdentifier>
            <_wcf:ExternalIdentifier ownerID="7000000000000000601">
               <_wcf:PartNumber>p_MAT153</_wcf:PartNumber>
               <_wcf:StoreIdentifier>
                  <_wcf:UniqueID>10551</_wcf:UniqueID>
               </_wcf:StoreIdentifier>
            </_wcf:ExternalIdentifier>
         </CatalogEntryIdentifier>
         <Description language="-1">
            <Name>Absorbent Pants Roll</Name>
            <ShortDescription>     universal XSMP133</ShortDescription>
            <LongDescription>These are my pants.</LongDescription>
            <Attributes name="auxDescription1">I need an aux description</Attributes>
         </Description>
      </CatalogEntry>
      <CatalogEntry>
         <CatalogEntryIdentifier>
            <_wcf:ExternalIdentifier ownerID="7000000000000000601">
               <_wcf:PartNumber>p_MAT203</_wcf:PartNumber>
               <_wcf:StoreIdentifier>
                  <_wcf:UniqueID>10551</_wcf:UniqueID>
               </_wcf:StoreIdentifier>
            </_wcf:ExternalIdentifier>
         </CatalogEntryIdentifier>
         <Description language="-1">
            <Name>Absorbent Mat Roll</Name>
            <ShortDescription>     universal XSMP133</ShortDescription>
            <LongDescription>These are not my pants. These are your pants.</LongDescription>
            <Attributes name="auxDescription1">These pants should be washed regularly.</Attributes>
         </Description>
      </CatalogEntry>
      <CatalogEntry>
         <CatalogEntryIdentifier>
            <_wcf:ExternalIdentifier ownerID="7000000000000000601">
               <_wcf:PartNumber>p_MAT185</_wcf:PartNumber>
               <_wcf:StoreIdentifier>
                  <_wcf:UniqueID>10551</_wcf:UniqueID>
               </_wcf:StoreIdentifier>
            </_wcf:ExternalIdentifier>
         </CatalogEntryIdentifier>
         <Description language="-1">
            <Name>Pants on a Roll</Name>
            <ShortDescription>     universal XSMP133</ShortDescription>
            <LongDescription>A roll of pants. Genuius. </LongDescription>
            <Attributes name="auxDescription1">Still more pants. Need a different aux description.</Attributes>
         </Description>
      </CatalogEntry>
   </DataArea>
</ChangeCatalogEntry>
    </soapenv:Body>
</soapenv:Envelope>
Was it helpful?

Solution

The answer turned out to be in the oa:ActionCriteria node. I needed a matching node for every instance of CatalogEntry.

        <oa:ActionCriteria>
            <oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[1]/Description[1]</oa:ActionExpression>
        </oa:ActionCriteria>
        <oa:ActionCriteria>
            <oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[2]/Description[1]</oa:ActionExpression>
        </oa:ActionCriteria>
        <oa:ActionCriteria>
            <oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[3]/Description[1]</oa:ActionExpression>
        </oa:ActionCriteria>

OTHER TIPS

Just to add to that: You can run several action son the same data object, to for instance create attributes , remove attributes, set SEO data etc. However, this can confuse the graph object if you don't sort the actions in the order of Add, Change and Delete.

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