2012-09-03 26 views
6


Tôi đang cố gắng tạo ứng dụng khách dịch vụ web bằng Visual Studio 2010. Máy khách hoạt động rất tốt nếu tôi sử dụng tệp wsdl trong phiên bản SOAP V2.
Khi tôi đặt thuộc tính WS-I Compliance thành Yes trong Magento và biên dịch lại trình khách dịch vụ web trong VS2010, nó không hoạt động !!! Một số phương thức biến mất khỏi tệp WSDL kết quả.
Tạo ứng dụng khách dịch vụ Web ở chế độ tuân thủ WS-I

Tôi đã tìm thấy cùng một sự cố nếu tôi tạo ứng dụng khách dịch vụ web java bằng công cụ wsimport.
Bất kỳ ý tưởng nào về những gì đang xảy ra?

Trả lời

2

Có lỗi trong mã Magento Core gốc, liên quan đến thao tác "catalogProductAttributeRemove" (lõi mô-đun/Mage/Danh mục).

Để giải quyết nó, tôi đã nhận xét các hoạt động sau đây trong tập tin wsi.xml của module Catalogue

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

Sau đó tòa nhà tự động của một khách hàng Dịch vụ Web sử dụng VS2010 hoạt động hoàn hảo !.

4

Tôi đã gặp vấn đề tương tự và thay vì nhận xét ra catalogProductAttributeRemove, tôi thực sự xem xét những gì còn thiếu và thêm các phần bổ sung vào tệp wsi.xml của tôi. Cảm ơn Juanma R. đã chỉ cho tôi theo hướng tệp cần được sửa.

Tôi đã tham chiếu các mục nhập cho danh mụcProductAttributeTạo làm điểm tham chiếu cho những phần khác có thể cần tồn tại để khắc phục sự cố này. Tôi không thực sự biết bất cứ điều gì về WSDL, chỉ cố gắng tìm kiếm những gì có thể bị thiếu.

Sau khi tôi thay đổi tệp, tôi đã làm mới tất cả bộ nhớ cache trong Magento và xác nhận các mục nhập mới được hiển thị trong tệp WSDL tại /index.php/api/v2_soap?wsdl=1. Sau đó tôi đã xóa tham chiếu web đã được thêm vào VS 2010 và đã thực hiện các bước thêm tham chiếu web lần nữa. Lần này sau khi thêm nó tôi đã không có lỗi.

Phiên bản Magento mà tôi đang vá là Magento Enterprise 1.12.0.2 nhưng tôi hy vọng nó có thể áp dụng cho các phiên bản khác có cùng lỗi với catalogProductAttributeRemove.

Đây là một diff nhanh Tôi chạy về những gì tôi đã thay đổi trong file 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

tôi bao gồm các diff vào wsi.xml từ phiên bản 1.7.2 và tải nó here.

Vì vậy, nếu bạn không thể đọc chính xác khác, bạn có thể sử dụng tệp này trực tiếp.

Các vấn đề liên quan