I want to extend the SOAP API for the category with own attributes.
- The first attribute is a simple text-value that should be stored in the database.
- The second attribute should be used to upload the category-image. Later it will be a complexType but for testing it is a simple string-element (like the first attribute). I want to transport the image-data with this attribute, save the physical image file in the update/create-function and set the attribute "thumbnail" in the category-object. So I don't need to store the second attribute in the database.
For this I've created a new extension with an install-script to create the first attribute. I've also created the file wsi.xml to insert both attributes in the WSDL for SOAP and extended Mage_Catalog_Model_Category_Api_V2 to manipulate the update-action for my needs. This works already. Both attributes are displayed in the WSDL.
This is how I've added the attributes in wsi.xml:
<xsd:element name="my_attribute_1" type="xsd:string" minOccurs="0" />
<xsd:element name="my_attribute_2" type="xsd:string" minOccurs="0" />
Now when I run catalogCategoryUpdate() I can set the first attribute (that I have inserted with my own extension and the install-script) and the value will be stored.
Now the problem: It seems that the second attribute (that I only need in the API) is not transferred to my update-function. When I dump the variable $categoryData into a logfile (to see whats in it) I can see that the second attribute is not there. I think magento removes this attribute because I haven't defined it in the install script.
The question: How can I define an own attribute in the SOAP-API to use it in the update-function but without create it in the database?
EDIT: I've edited my problem-description because I've found out the following things:
I've tested the script with the soap-call for catalogCategoryInfo() on different locations to see if my own attributes will be returned or not. This is the resut:
- Call script on the server with the magento-project: my own attributes are missing
- Call script on my local server (XAMPP): returns the data with my own attributes
- Call script on an other server: returns the data with my own attributes
At this morning I've called the script on my local server so my first attribute was there. Then I swiched to test on the server with the magento-project and there it didn't worked anymore (I thought only the second attribute didn't worked but it were both...)
SO THE QUESTION IS:
How can the server where the script with the soap-call is placed influence the returned values? Which server-configuration has this effect?