Mule 3.5中的Magento接头

Mule 3.5中的Magento接头,magento,mule,Magento,Mule,我已尝试创建Megento connector示例程序,如Megento connector视频链接中所示 我的流程是: <magento:config name="MagentoConnector" username="${magento.username}" password="${magento.password}" address="${magento.address}" doc:name="Magento"> <magento:connection-pooli

我已尝试创建Megento connector示例程序,如Megento connector视频链接中所示

我的流程是:

<magento:config name="MagentoConnector" username="${magento.username}" password="${magento.password}" address="${magento.address}" doc:name="Magento">
    <magento:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
</magento:config>
<flow name="ShoppingCartOPerations" doc:name="ShoppingCartOPerations">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="shoppingCartOperation" doc:name="HTTP"/>
    <flow-ref name="CreateProduct" doc:name="Flow Reference"/>
    <set-payload value="Product Id is #[groovy:message.getProperty('productId')]" doc:name="Set Payload"/>
</flow>
<sub-flow name="CreateProduct" doc:name="CreateProduct">
    <magento:create-product config-ref="MagentoConnector" type="simple" set="1" sku="simple_sku" storeViewIdOrCode="4" doc:name="Create Product" address="https://sashistore.gostorego.com/api/v2_soap" password="gdskey" username="gdssrao">
        <magento:attributes name="SampleProduct" description="TestProduct" short_description="creating sample product" weight="100" status="1" visibility="4" price="100" tax_class_id="1"/>
    </magento:create-product>
    <set-property propertyName="productId" value="#[payload]" doc:name="Store Product id"/>
    <magento:update-inventory-stock-item config-ref="MagentoConnector" productId="#[groovy:message.getProperty('productId')]" doc:name="Update Stock">
        <magento:catalog-inventory-stock-item qty="33" is_in_stock="100" min_qty="10"/>
    </magento:update-inventory-stock-item>
</sub-flow>


错误2014-01-29 23:48:48521[[MagentTest].connector.http.mule.default.receiver.02]org.mule.retry.notifiers.ConnectNotifier:连接失败/重新连接:工作描述符。根异常为:null。类型:类org.mule.api.ConnectionException
错误2014-01-29 23:48:48524[[magentotest].connector.http.mule.default.receiver.02]org.mule.exception.defaultMessagineExceptionStrategy:

您已经在magento:create product中定义了明文连接属性(用户名、密码、地址),然后在magento:config中将它们作为应用程序属性。这实际上没有意义,因为在其他元素中使用config ref时,只需要定义一次属性(在config元素中)。由于连接失败,我猜您在config元素中的属性不正确。尝试使用magento中的属性:创建产品

编辑:我检查了您的MagentoAPI,似乎您的地址不正确

试着改用

EDIT2:我从中获得了MagentoAPIv2的WSDL URL。有关如何从WSDL获取Web服务地址的说明,请参见第页。


<magento:config name="MagentoConnector" username="gdssrao" password="gdskey" address="https://sashistore.gostorego.com/api/v2_soap" doc:name="Magento">
    <magento:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
</magento:config>
<flow name="ShoppingCartOPerationsFlow" doc:name="ShoppingCartOPerationsFlow">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="shoppingCartOperation" doc:name="HTTP"/>
    <logger level="INFO" doc:name="Logger"/>
    <flow-ref name="CreateProductFlow" doc:name="Flow Reference"/>
    <logger level="INFO" doc:name="Logger"/>
    <set-payload value="Product Id is #[groovy:message.getProperty('productId')]" doc:name="Set Payload"/>
</flow>
<sub-flow name="CreateProductFlow" doc:name="CreateProductFlow">
    <magento:create-product config-ref="MagentoConnector" type="simple" set="1" sku="simple_sku" storeViewIdOrCode="4" doc:name="Create Product">
    <magento:attributes name="SampleProduct" description="TestProduct" short_description="creating sample product" weight="100"  visibility="4" />
    </magento:create-product>
     <logger level="INFO" doc:name="Logger"/>
    <set-property propertyName="productId" value="#[payload]" doc:name="Store Product id"/>
    <logger level="INFO" doc:name="Logger"/>
    <magento:update-inventory-stock-item config-ref="MagentoConnector" productId="#[groovy:message.getProperty('productId')]" doc:name="Update Stock">
        <magento:catalog-inventory-stock-item   />
    </magento:update-inventory-stock-item>
</sub-flow>

酷!!它正在使用此URL。你能告诉我如何找到正确的网址吗。旧url也在Magento连接创建中工作,但在调用操作时失败了?没有什么神奇的,我只是检查了您服务的WSDL,如Magento文档()中所述。WSDL定义了发送SOAP调用的“端口”(通常带有URL)的名称。