Magento Custom API soap V2

时间:2014-07-15 10:46:00

标签: php magento soap

我正在尝试创建一个新的SOAP V2自定义API,它将更新我的产品自定义字段。

我尝试过很多教程,但仍未成功。

我试过这些链接 - http://inchoo.net/ecommerce/magento/magento-api-v2/ - http://inchoo.net/ecommerce/magento/magento-v2-soap-demystified/

错误 - 函数(“moduleGroupPriceValue”)不是此服务的有效方法。

api.xml

    <?xml version="1.0"?>
<config>
        <api>
                <resources>
                        <oxman translate="title" module="sigma_groupprice">
                        <title>Title Of My Resource</title>
                        <model>groupprice/objectmodel_api</model>
                                <methods>
                                        <groupPriceValue translate="title" module="sigma_groupprice">
                                                <title>Title Of My Method</title>
                                        </groupPriceValue>
                                </methods>
                        </oxman>
                </resources>
                <v2>
                    <resources_function_prefix>
                            <oxman>oxmanObjectmodel</oxman>
                    </resources_function_prefix>
                </v2>
        </api>
</config>

wsdl.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/" xmlns="http://schemas.xmlsoap.org/wsdl/"
    name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
            <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />

             <complexType name="groupPriceValueEntity">
                <all>
                    <element name="sku" type="xsd:string" />
                    <element name="cust_group" type="xsd:int" />
                    <element name="price" type="xsd:double" />
                </all>
            </complexType>
            <complexType name="groupPriceValueEntityArray">
                <complexContent>
                    <restriction base="soapenc:Array">
                        <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:groupPriceValueEntity[]" />
                    </restriction>
                </complexContent>
            </complexType>


        </schema>
    </types>
    <message name="groupPriceValueRequest">
        <part name="sessionId" type="xsd:string"/>
        <part name="message" type="xsd:string" />
    </message>
    <message name="groupPriceValueResponse">
        <part name="result" type="xsd:string" />
    </message>
    <portType name="{{var wsdl.handler}}PortType">
        <operation name="groupPriceValue">
            <documentation>Group Price Value</documentation>
            <input message="typens:groupPriceValueRequest" />
            <output message="typens:groupPriceValueResponse" />
        </operation>
    </portType>
    <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
        <operation name="groupPriceValue">
            <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
            <input>
                <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
            </input>
            <output>
                <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
            </output>
        </operation>
    </binding>
    <service name="{{var wsdl.name}}Service">
        <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
            <soap:address location="{{var wsdl.url}}" />
        </port>
    </service>
</definitions>

请帮帮我。

0 个答案:

没有答案