Mule:Magento connector: get-product operation bug

2019-06-14 05:12发布

问题:

I am trying to get product info from magneto via magneto connector in mule USING GET-PRODUCT OPERATION, but I am getting this error: Product not existseven though tested via SOAP UI and worked perfectly. After a long search I have found the issue:

  • request via SOAP UI:

    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:catalogProductInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <sessionId xsi:type="xsd:string"/>
             <productId xsi:type="xsd:string"/>
             <storeView xsi:type="xsd:string"></storeView>
             <attributes xsi:type="urn:catalogProductRequestAttributes">
                <attributes xsi:type="urn:ArrayOfString" soapenc:arrayType="xsd:string[]">
                 </attributes>
             <additional_attributes xsi:type="urn:ArrayOfString" soapenc:arrayType="xsd:string[]">
                </additional_attributes>
             </attributes>
             <identifierType xsi:type="xsd:string"/>
         </urn:catalogProductInfo>
      </soapenv:Body>
    </soapenv:Envelope>
    
  • request via magneto connector:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
          <ns1:catalogProductInfo xmlns:ns1="urn:Magento" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <sessionId xsi:type="xsd:string"></sessionId>
             <product xsi:type="xsd:string"></product>
             <storeView xsi:type="xsd:string" xsi:nil="true"/>
             <attributes href="#id0"/>
             <productIdentifierType xsi:type="xsd:string"></productIdentifierType>
         </ns1:catalogProductInfo>
       <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:Magento" id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:catalogProductRequestAttributes">
        <attributes soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
         <attributes xsi:type="xsd:string"></attributes>
        </attributes>
        <additional_attributes soapenc:arrayType="xsd:string[0]" xsi:type="soapenc:Array"/>
      </multiRef>
     </soapenv:Body>
    </soapenv:Envelope>
    

the difference is in the <product>/<productId> tag.

Any ideas on how to fix?

回答1:

Found the issue: it's in the magento_v2_soap.wsdl of the magento connector file where in the catalogProductInfoRequest the <part name="product" type="xsd:string"/>needs to be changed to <part name="productId" type="xsd:string"/> I have made the change in gitHub but I don't have write access... so what I did is I made the change downloaded and installed in mule.