2012-09-03 39 views
6


我試圖創建一個使用Visual Studio 2010中 客戶端的作品非常好,如果我使用版本SOAP V2的WSDL文件的Web服務客戶端。
當我在Magento中將屬性WS-I Compliance設置爲Yes並重新編譯VS2010中的Web服務客戶端時,它不起作用!某些方法從生成的WSDL文件中消失。
產生WS-I兼容模式Web服務客戶端

如果我使用工具wsimport生成java web服務客戶端,我發現了同樣的問題。
有什麼想法發生了什麼?

回答

2

原始Magento Core代碼存在與「catalogProductAttributeRemove」(模塊核心/ Mage/Catalog)操作相關的錯誤。

爲了解決這個問題,我發表過評論如下操作的模塊目錄

<!--wsdl:operation name="catalogProductAttributeRemove"> 
    <wsdl:documentation>Delete attribute</wsdl:documentation> 
    <wsdl:input message="typens:catalogProductAttributeRemoveRequest" /> 
    <wsdl:output message="typens:catalogProductAttributeRemoveResponse" /> 
</wsdl:operation--> 

之後的wsi.xml文件中使用VS2010 Web服務客戶端的自動構建完美的作品!

4

我遇到了同樣的問題,而不是註釋掉catalogProductAttributeRemove,我實際上查看了缺少的內容,並將其他部分添加到我的wsi.xml文件中。感謝Juanma R.指出我需要糾正的文件方向。

我引用catalogProductAttributeCreate的條目作爲其他節可能需要存在的參考點來解決此問題。我真的不知道WSDL的任何內容,只是試圖尋找可能丟失的東西。

我更改了文件後,我刷新了Magento中的所有緩存,並確認新條目顯示在/index.php/api/v2_soap?wsdl=1的WSDL文件中。然後,我刪除了添加到VS 2010的Web引用,並再次添加了Web引用。這次加入後我沒有錯誤。

我正在修補的Magento版本是Magento Enterprise 1.12.0.2,但我希望它適用於其他版本,這些版本顯示與catalogProductAttributeRemove相同的錯誤。

這裏是一個快速DIFF我跑的我在wsi.xml文件改變:

*** Z:\mage-1-12-0-2.dev\htdocs\app\code\core\Mage\Catalog\etc\wsi - Copy.xml backup Tue Jul 3 12:08:31 2012 UTC 
--- Z:\mage-1-12-0-2.dev\htdocs\app\code\core\Mage\Catalog\etc\wsi.xml Fri Nov 9 18:40:58 2012 UTC 
*************** 
*** 1509,1520 **** 
        <xsd:complexType> 
         <xsd:sequence> 
          <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:string" /> 
         </xsd:sequence> 
        </xsd:complexType> 
       </xsd:element> 
      </xsd:schema> 
     </wsdl:types> 
     <wsdl:message name="catalogProductCurrentStoreRequest"> 
      <wsdl:part name="parameters" element="typens:catalogProductCurrentStoreRequestParam" /> 
     </wsdl:message> 
     <wsdl:message name="catalogProductCurrentStoreResponse"> 
--- 1509,1540 ---- 
        <xsd:complexType> 
         <xsd:sequence> 
          <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:string" /> 
         </xsd:sequence> 
        </xsd:complexType> 
       </xsd:element> 
+ 
+   
+ <!-- Added by Matt Johnson 2012-11-09 to fix VS 2010 support of SOAP reference --> 
+   <xsd:element name="catalogProductAttributeRemoveRequestParam"> 
+    <xsd:complexType> 
+     <xsd:sequence> 
+      <xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string" /> 
+      <xsd:element minOccurs="1" maxOccurs="1" name="attribute" type="xsd:string" /> 
+     </xsd:sequence> 
+    </xsd:complexType> 
+   </xsd:element> 
+   <xsd:element name="catalogProductAttributeRemoveResponseParam"> 
+    <xsd:complexType> 
+     <xsd:sequence> 
+      <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:boolean" /> 
+     </xsd:sequence> 
+    </xsd:complexType> 
+   </xsd:element> 
+   
+   
      </xsd:schema> 
     </wsdl:types> 
     <wsdl:message name="catalogProductCurrentStoreRequest"> 
      <wsdl:part name="parameters" element="typens:catalogProductCurrentStoreRequestParam" /> 
     </wsdl:message> 
     <wsdl:message name="catalogProductCurrentStoreResponse"> 
*************** 
*** 1883,1894 **** 
     <wsdl:message name="catalogProductAttributeCreateRequest"> 
      <wsdl:part name="parameters" element="typens:catalogProductAttributeCreateRequestParam" /> 
     </wsdl:message> 
     <wsdl:message name="catalogProductAttributeCreateResponse"> 
      <wsdl:part name="parameters" element="typens:catalogProductAttributeCreateResponseParam" /> 
     </wsdl:message> 
     <wsdl:portType name="{{var wsdl.handler}}PortType"> 
      <wsdl:operation name="catalogCategoryCurrentStore"> 
       <wsdl:documentation>Set_Get current store view</wsdl:documentation> 
       <wsdl:input message="typens:catalogCategoryCurrentStoreRequest" /> 
       <wsdl:output message="typens:catalogCategoryCurrentStoreResponse" /> 
      </wsdl:operation> 
--- 1903,1923 ---- 
     <wsdl:message name="catalogProductAttributeCreateRequest"> 
      <wsdl:part name="parameters" element="typens:catalogProductAttributeCreateRequestParam" /> 
     </wsdl:message> 
     <wsdl:message name="catalogProductAttributeCreateResponse"> 
      <wsdl:part name="parameters" element="typens:catalogProductAttributeCreateResponseParam" /> 
     </wsdl:message> 
+ 
+ <!-- Added by Matt Johnson 2012-11-09 to fix VS 2010 support of SOAP reference --> 
+ <wsdl:message name="catalogProductAttributeRemoveRequest"> 
+  <wsdl:part name="parameters" element="typens:catalogProductAttributeRemoveRequestParam" /> 
+ </wsdl:message> 
+ <wsdl:message name="catalogProductAttributeRemoveResponse"> 
+  <wsdl:part name="parameters" element="typens:catalogProductAttributeRemoveResponseParam" /> 
+ </wsdl:message> 
+ 
     <wsdl:portType name="{{var wsdl.handler}}PortType"> 
      <wsdl:operation name="catalogCategoryCurrentStore"> 
       <wsdl:documentation>Set_Get current store view</wsdl:documentation> 
       <wsdl:input message="typens:catalogCategoryCurrentStoreRequest" /> 
       <wsdl:output message="typens:catalogCategoryCurrentStoreResponse" /> 
      </wsdl:operation> 
*************** 
*** 2760,2771 **** 
        <soap:body use="literal" /> 
       </wsdl:input> 
       <wsdl:output> 
        <soap:body use="literal" /> 
       </wsdl:output> 
      </wsdl:operation> 
     </wsdl:binding> 
     <wsdl:service name="{{var wsdl.name}}Service"> 
      <wsdl:port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding"> 
       <soap:address location="{{var wsdl.url}}" /> 
      </wsdl:port> 
     </wsdl:service> 
--- 2789,2814 ---- 
        <soap:body use="literal" /> 
       </wsdl:input> 
       <wsdl:output> 
        <soap:body use="literal" /> 
       </wsdl:output> 
      </wsdl:operation> 
+ 
+ 
+ <!-- Added by Matt Johnson 2012-11-09 to fix VS 2010 support of SOAP reference -->   
+  <wsdl:operation name="catalogProductAttributeRemove"> 
+   <soap:operation soapAction="" /> 
+   <wsdl:input> 
+    <soap:body use="literal" /> 
+   </wsdl:input> 
+   <wsdl:output> 
+    <soap:body use="literal" /> 
+   </wsdl:output> 
+  </wsdl:operation> 
+  
+  
     </wsdl:binding> 
     <wsdl:service name="{{var wsdl.name}}Service"> 
      <wsdl:port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding"> 
       <soap:address location="{{var wsdl.url}}" /> 
      </wsdl:port> 
     </wsdl:service> 
2

我列入DIFF到wsi.xml從1.7.2版本,並上載here

所以,如果你不能讀取正確的比較,你可以直接使用這個文件。