Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento Enterprise 1.12-从V2 API访问客户自定义属性_Api_Magento_Soap - Fatal编程技术网

Magento Enterprise 1.12-从V2 API访问客户自定义属性

Magento Enterprise 1.12-从V2 API访问客户自定义属性,api,magento,soap,Api,Magento,Soap,我有一个客户希望使用Magento的web服务API来创建和更新客户。使用API,我们可以使用V1或V2 API轻松地操作系统定义的属性-firstname、lastname等。我们可以去那里 这就是问题所在-该网站使用Magento Enterprise 1.12,我们添加了一些自定义客户属性,用于将Magento客户链接到外部系统上的CRM数据。使用v1api,我可以完全访问自定义属性。但是,v2api不会公开它们。由于调用方来自.NET,我认为他需要使用v2API 使用调试器跟踪代码,我看

我有一个客户希望使用Magento的web服务API来创建和更新客户。使用API,我们可以使用V1或V2 API轻松地操作系统定义的属性-firstname、lastname等。我们可以去那里

这就是问题所在-该网站使用Magento Enterprise 1.12,我们添加了一些自定义客户属性,用于将Magento客户链接到外部系统上的CRM数据。使用v1api,我可以完全访问自定义属性。但是,v2api不会公开它们。由于调用方来自.NET,我认为他需要使用v2API

使用调试器跟踪代码,我看到V2代码获取所有属性数据,然后在生成web服务响应时删除所有自定义数据。我尝试将属性添加到Customer(Mage/Customer/etc/)WSDL和WSI文件中,但没有成功

谁能给我一个指针,告诉我应该如何公开客户属性

格雷格

  • 创建一个新模块
  • Your_模块/etc/wsdl.xml
    wsi.xml
    中,在与Mage_客户
    wsdl.xml
    wsi.xml
    相同的节点中添加新属性
  • Magento将所有
    wsdl.xml
    wsi.xml
    文件合并在一起

  • 下面是一个wsdl.xml文件的示例,我使用该文件将customer_number添加到API中

    <?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="customerCustomerEntity">
                 <all>
                   <element name="customer_number" type="xsd:string" minOccurs="0" />
                 </all>
              </complexType>
           </schema>
        </types>
    </definitions>          
    

    深入研究,我现在看到,要将API V2访问添加到自定义属性,只需将附加字段添加到customer wsdl.xml和wsi.xml文件中即可。新的问题是我无法找到覆盖核心wsdl的正确方法。我尝试在app/code/local/customer/etc/wsdl.xml中放置一个修改后的副本,但这些更改似乎没有覆盖app/code/core/customer/etc/wsdl.xml中的wsdl。有什么想法吗?我担心在core中修改wsdl,但在这种情况下我可能不得不这样做。