0

Very new to Magento and having some issues extending it.

I need to add some attributes to the existing SOAP API.

I have the code working to add those attributes and if I add them to the WSDL and the WSI in the core it works fine, but whenever I remove them from the core and add files to the etc location in my local code dir it fails to work.

Specifically the API I am updating is salesOrderInfo.

I have created my override file inside /app/code/local/Mage/Sales/Model/Order/Api.php

I have put the following code in this location: /app/code/local/Mage/Sales/etc/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">
        <complexType name="salesOrderItemEntity">
            <all>
               <element name="pvx_line_price" type="xsd:string" minOccurs="0" />
            </all>
        </complexType>
    </schema>
</types>

and the other one is here: /app/code/local/Mage/Sales/etc/wsi.xml

<?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="salesOrderItemEntity">
            <xsd:sequence>
        <xsd:element name="pvx_line_price" type="xsd:string" minOccurs="0" />
            </xsd:sequence>
        </xsd:complexType>
    </xsd:schema>
</wsdl:types>

I have tried so many times to work out what caches I might need to disable, rebuild etc but I've hit pretty much the end of my tether on this one. I've exhausted all the googling and tutorials I can find. I am basically following what I think should work.

Please bear in mind in your reply I am new to Magento so may not know how to do what you are describing. That said I am not new to PHP. It has to be said in all the years I have never found such a complex system to extend.

  • do you still need help with this? – Alex Paliarush Dec 20 '15 at 21:53
  • Yes please, if you can – Craigk Dec 22 '15 at 0:55
1

Create a new module under local and put extension wsdl.xml to app/code/local/VendorName/ModuleName/etc/wsdl.xml. Then it will be correctly merged into resulting WSDL document.

| improve this answer | |
  • As I am certain I tried that over and over for a couple of days with tiny variations, can you be very specific (as in file by file). I know that is a pain, but I've hit the point where I have all but given up. – Craigk Dec 22 '15 at 15:52
  • Just don't use the same path as for core config /app/code/local/Mage/Sales/etc/wsi.xml, create custom module and add extension configuration there. I'm almost sure that overriding for classes in local works because it is supported by autoloader, but for configs it will not work as you expected. – Alex Paliarush Dec 22 '15 at 16:02
  • I'm sorry to be a pain, but I am very new to Magento and I have tried a lot of things. So far you are describing something I have tried. Unless you are going to give me a file by file or step by step guide I don't know what is different about what you are suggesting. – Craigk Dec 22 '15 at 16:12
  • Create new module as described here and put your wsi.xml and wsdl.xml there (they both look good) – Alex Paliarush Dec 22 '15 at 16:18
  • OK, I followed that tutorial as far as the title "Defining An Event Observer" (aka, when they finished the initial part of creating the folders and the config file). My plugin is enabled and showing in the config pages. I then added my files to the etc directory in my plugin and refreshed the cache, recompiled and refreshed the WSDL on this url: /index.php/api/v2_soap/index/?wsdl=1 It does not contain any of my settings. This is what I did before. – Craigk Dec 22 '15 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.