Php 自定义Magento API方法WS-I冲突

Php 自定义Magento API方法WS-I冲突,php,magento,soap,wsdl,ws-i,Php,Magento,Soap,Wsdl,Ws I,为了使以下Magento选项具有SOAP方法,我制作了两个不同的Magento扩展: 捆绑产品协会 价格组分配 我正在从Navision(ERP)管理我的目录,因此我使用WSI.xml文件准备了两个兼容WSI的选项 每件事都像一个魔咒一样分别使用两个API扩展,但是当我将它们都激活时,我收到一个调用第二个的错误,它表示第一个方法的参数丢失(奇怪…) 这就是我得到的错误: 2015-02-09T17:47:59+00:00 ERR (3): exception 'Exception' wit

为了使以下Magento选项具有SOAP方法,我制作了两个不同的Magento扩展:

  • 捆绑产品协会
  • 价格组分配
我正在从Navision(ERP)管理我的目录,因此我使用WSI.xml文件准备了两个兼容WSI的选项

每件事都像一个魔咒一样分别使用两个API扩展,但是当我将它们都激活时,我收到一个调用第二个的错误,它表示第一个方法的参数丢失(奇怪…)

这就是我得到的错误:

2015-02-09T17:47:59+00:00 ERR (3): 
exception 'Exception' with message 'Required parameter "item_options" is missing.' in C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server\Wsi\Handler.php:171
Stack trace:
#0 C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server\Wsi\Handler.php(76): Mage_Api_Model_Server_WSI_Handler->prepareArgs(Array, Array)
#1 [internal function]: Mage_Api_Model_Server_WSI_Handler->__call('bundleapiBundle...', Array)
#2 [internal function]: Mage_Api_Model_Server_WSI_Handler->bundleapiBundleapiAssign(Object(stdClass))
#3 C:\wamp\www\eltalleronline\lib\Zend\Soap\Server.php(832): SoapServer->handle('<?xml version="...')
#4 C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server\Wsi\Adapter\Soap.php(88): Zend_Soap_Server->handle()
#5 C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server.php(138): Mage_Api_Model_Server_WSI_Adapter_Soap->run()
#6 C:\wamp\www\eltalleronline\app\code\core\Mage\Api\controllers\V2\SoapController.php(46): Mage_Api_Model_Server->run()
#7 C:\wamp\www\eltalleronline\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Api_V2_SoapController->indexAction()
#8 C:\wamp\www\eltalleronline\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#9 C:\wamp\www\eltalleronline\app\code\community\ArtsOnIT\OfflineMaintenance\Controller\Router\Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 C:\wamp\www\eltalleronline\app\code\core\Mage\Core\Controller\Varien\Front.php(172): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 C:\wamp\www\eltalleronline\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 C:\wamp\www\eltalleronline\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#13 C:\wamp\www\eltalleronline\index.php(85): Mage::run('', 'store')
#14 {main}
2015-02-09T17:47:59+00:00错误(3):
在C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server\Wsi\Handler.php:171中缺少带有消息“必需参数”item\u options”的异常“exception”
堆栈跟踪:
#0 C:\wamp\www\eltalleronline\app\code\core\Mage\Api\Model\Server\Wsi\Handler.php(76):Mage\u Api\u Model\u Server\u Wsi\u Handler->prepareArgs(数组,数组)
#1[内部函数]:Mage\u Api\u Model\u Server\u WSI\u Handler->\u调用('bundleAppibundle…',数组)
#2[内部函数]:Mage\u Api\u Model\u Server\u WSI\u Handler->bundleIBundleAppIASSign(对象(stdClass))
#3c:\wamp\www\eltalleronline\lib\Zend\Soap\Server.php(832):SoapServer->handle('
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:typens="urn:{{var wsdl.name}}"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              name="{{var wsdl.name}}"
              targetNamespace="urn:{{var wsdl.name}}">
    <wsdl:types>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:{{var wsdl.name}}">
            <xsd:complexType name="bundleapiBundleapiItem">
                <xsd:sequence>
                    <xsd:element name="title" type="xsd:string" minOccurs="0" />
                    <xsd:element name="option_id" type="xsd:string" minOccurs="0" />
                    <xsd:element name="delete" type="xsd:string" minOccurs="0" />
                    <xsd:element name="type" type="xsd:string" minOccurs="0" />
                    <xsd:element name="required" type="xsd:string" minOccurs="0" />
                    <xsd:element name="position" type="xsd:string" minOccurs="0" />
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="bundleapiBundleapiOptions">
                <xsd:sequence>
                    <xsd:element name="product_id" type="xsd:string" minOccurs="0" />
                    <xsd:element name="selection_id" type="xsd:string" minOccurs="0" />
                    <xsd:element name="option_id" type="xsd:string" minOccurs="0" />
                    <xsd:element name="delete" type="xsd:string" minOccurs="0" />
                    <xsd:element name="selection_price_value" type="xsd:string" minOccurs="0" />
                    <xsd:element name="selection_price_type" type="xsd:string" minOccurs="0" />
                    <xsd:element name="selection_can_change_qty" type="xsd:string" minOccurs="0" />
                    <xsd:element name="selection_qty" type="xsd:string" minOccurs="0" />
                    <xsd:element name="is_default" type="xsd:string" minOccurs="0" />
                    <xsd:element name="position" type="xsd:string" minOccurs="0" />
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="bundleapiBundleapiAssignRequestParam">
                <xsd:complexType>
                    <xsd:sequence>
                            <xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string" />
                            <xsd:element minOccurs="1" maxOccurs="1" name="items" type="typens:bundleapiBundleapiItem" />
                            <xsd:element minOccurs="1" maxOccurs="1" name="item_options" type="typens:bundleapiBundleapiOptions" />
                            <xsd:element minOccurs="1" maxOccurs="1" name="bundle_id" type="xsd:string" />
                            <xsd:element minOccurs="1" maxOccurs="1" name="store_id" type="xsd:string" />
                        </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="bundleapiBundleapiAssignResponseParam">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:string" />
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="bundleapiBundleapiAssignRequest">
        <wsdl:part name="parameters" type="typens:bundleapiBundleapiAssignRequestParam"/>
    </wsdl:message>
    <wsdl:message name="bundleapiBundleapiAssignResponse">
        <wsdl:part name="parameters" type="typens:bundleapiBundleapiAssignResponseParam" />
    </wsdl:message>
    <wsdl:portType name="{{var wsdl.handler}}PortType">
        <wsdl:operation name="bundleapiBundleapiAssign">
            <wsdl:documentation>API method assign products to bundle</wsdl:documentation>
            <wsdl:input message="typens:bundleapiBundleapiAssignRequest" />
            <wsdl:output message="typens:bundleapiBundleapiAssignResponse" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="bundleapiBundleapiAssign">
            <soap:operation soapAction="" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="{{var wsdl.name}}Service">
        <wsdl:port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
            <soap:address location="{{var wsdl.url}}" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:typens="urn:{{var wsdl.name}}"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              name="{{var wsdl.name}}"
              targetNamespace="urn:{{var wsdl.name}}">
    <wsdl:types>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:{{var wsdl.name}}">
            <xsd:complexType name="catalogProductGroupPriceEntity">
                <xsd:sequence>
                    <xsd:element name="customer_group_id" type="xsd:string" minOccurs="0" />
                    <xsd:element name="website" type="xsd:string" minOccurs="0" />
                    <xsd:element name="price" type="xsd:double" minOccurs="0" />
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="catalogProductGroupPriceEntityArray">
                <xsd:sequence>
                    <xsd:element minOccurs="0" maxOccurs="unbounded" name="complexObjectArray" type="typens:catalogProductGroupPriceEntity" />
                </xsd:sequence>
            </xsd:complexType>

            <xsd:element name="pricegroupapiPricegroupapiUpdateRequestParam">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string" />
                        <xsd:element minOccurs="1" maxOccurs="1" name="productId" type="xsd:string" />
                        <xsd:element minOccurs="1" maxOccurs="1" name="group_price" type="typens:catalogProductGroupPriceEntityArray" />
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

            <xsd:element name="pricegroupapiPricegroupapiUpdateResponseParam">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:int" />
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="pricegroupapiPricegroupapiUpdateRequest">
        <wsdl:part name="parameters" type="typens:pricegroupapiPricegroupapiUpdateRequestParam"/>
    </wsdl:message>
    <wsdl:message name="pricegroupapiPricegroupapiUpdateResponse">
        <wsdl:part name="parameters" type="typens:pricegroupapiPricegroupapiUpdateResponseParam" />
    </wsdl:message>
    <wsdl:portType name="{{var wsdl.handler}}PortType">
        <wsdl:operation name="pricegroupapiPricegroupapiUpdate">
            <wsdl:documentation>API method assign prices to a customer group</wsdl:documentation>
            <wsdl:input message="typens:pricegroupapiPricegroupapiUpdateRequest" />
            <wsdl:output message="typens:pricegroupapiPricegroupapiUpdateResponse" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="pricegroupapiPricegroupapiUpdate">
            <soap:operation soapAction="" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="{{var wsdl.name}}Service">
        <wsdl:port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
            <soap:address location="{{var wsdl.url}}" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
$productId = 5813;
$tierPrices = array(
    array('customer_group_id' => '3', 'website' => '0', 'price' => '0.7989'),
    array('customer_group_id' => '6', 'website' => '0', 'price' => '0.9187')
);

try{
    $result = $proxy->pricegroupapiPricegroupapiUpdate((object)array(
        'sessionId' => $sessionId->result,
        'productId' => $productId,
        'group_price' => $tierPrices,
        'items' => NULL
    ));
}catch(SoapFault $e){
    echo "<pre>";var_dump($e);echo "</pre>";
}