Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Please look at my below custom code, may be its help you,</p> <p><strong>api.xml</strong></p> <pre><code>&lt;config&gt; &lt;modules&gt; &lt;Agentgallery&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;/Agentgallery&gt; &lt;/modules&gt; &lt;api&gt; &lt;resources&gt; &lt;agentgallery translate="title" module="agentgallery"&gt; &lt;model&gt;agentgallery/api&lt;/model&gt; &lt;title&gt;Tax Rule Api&lt;/title&gt; &lt;acl&gt;agentgallery&lt;/acl&gt; &lt;methods&gt; &lt;gettaxrule translate="title" module="agentgallery"&gt; &lt;title&gt;Retrieve tax rule data&lt;/title&gt; &lt;acl&gt;agentgallery/gettaxrule&lt;/acl&gt; &lt;/gettaxrule&gt; &lt;/methods&gt; &lt;/agentgallery&gt; &lt;/resources&gt; &lt;acl&gt; &lt;resources&gt; &lt;agentgallery translate="title" module="agentgallery"&gt; &lt;title&gt;Tax Rule&lt;/title&gt; &lt;gettaxrule translate="title" module="agentgallery"&gt; &lt;title&gt;Get tax rule&lt;/title&gt; &lt;/gettaxrule&gt; &lt;/agentgallery&gt; &lt;all&gt; &lt;/all&gt; &lt;/resources&gt; &lt;/acl&gt; &lt;/api&gt; &lt;/config&gt; </code></pre> <p><strong>wsdl.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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}}"&gt; &lt;message name="agentgalleryGettaxruleRequest"&gt; &lt;part name="sessionId" type="xsd:string" /&gt; &lt;part name="arg" type="xsd:string" /&gt; &lt;/message&gt; &lt;message name="agentgalleryGettaxruleResponse"&gt; &lt;part name="result" type="xsd:string" /&gt; &lt;/message&gt; &lt;portType name="{{var wsdl.handler}}PortType"&gt; &lt;operation name="agentgalleryGettaxrule"&gt; &lt;documentation&gt;Test Method&lt;/documentation&gt; &lt;input message="typens:agentgalleryGettaxruleRequest" /&gt; &lt;output message="typens:agentgalleryGettaxruleResponse" /&gt; &lt;/operation&gt; &lt;/portType&gt; &lt;binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType"&gt; &lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /&gt; &lt;operation name="agentgalleryGettaxrule"&gt; &lt;soap:operation soapAction="urn:{{var wsdl.handler}}Action" /&gt; &lt;input&gt; &lt;soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /&gt; &lt;/input&gt; &lt;output&gt; &lt;soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /&gt; &lt;/output&gt; &lt;/operation&gt; &lt;/binding&gt; &lt;/definitions&gt; </code></pre> <p><strong>Api.php inside module's model folder</strong></p> <pre><code>&lt;?php class Namespace_Modulename_Model_Api extends Mage_Api_Model_Resource_Abstract { public function gettaxrule($customerTaxClass,$productTaxClass) { $result = Mage::getResourceModel('tax/calculation')-&gt;getRatesForWebservices($customerTaxClass,$productTaxClass); //here you can paste your code whatever you need instead of $result variable return $result; } } ?&gt; </code></pre> <p><strong>V2.php file inside model/Objectmodel/api/ folder</strong></p> <pre><code>&lt;?php class Namespace_Modulename_Model_Objectmodel_Api_V2 extends Companyname_Modulename_Model_Objectmodel_Api { } ?&gt; </code></pre> <p>after you can call your method like below Here you create object of api after call method like this</p> <pre><code>$result = $checkData-&gt;proxyObj()-&gt;call($sessionId, 'agentgallery.gettaxrule',array($customerTaxClass,$productTaxClass)); </code></pre> <p>here "agentgallery.gettaxrule" is Custom Method.</p> <p>Try this</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload