2012-09-03 12 views
6


Visual Studio 2010 kullanarak bir web hizmeti istemcisi oluşturmaya çalışıyorum. wsdl dosyasını SOAP V2 sürümünde kullanırsam istemci çok iyi çalışır.
Magento'da WS-I Compliance özelliğini Yes olarak ayarladığımda ve web hizmeti istemcisini VS2010'da yeniden derlerken, işe yaramaz! Bazı yöntemler sonuç WSDL dosyasından kaybolur.
WS-I uyumluluk modunda Web Hizmeti İstemcisi Oluşturun

wsimport aracını kullanarak bir java web hizmeti istemcisi oluşturuyorsam aynı sorunu buldum.
Neler olduğu hakkında bir fikrin var mı?

cevap

2

"catalogProductAttributeRemove" (modül çekirdeği/Mage/Catalog) işlemi ile ilgili orijinal Magento Core kodunda bir hata var.

çözmek için, VS2010 kullanarak bir Web Servis Müşterinin otomatik bina mükemmel çalışıyor modül Katalog Bundan sonra

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

ait wsi.xml dosyasında aşağıdaki operasyonu yorumladı ettik !.

4

Aynı soruna rastladım ve catalogProductAttributeRemove hakkında yorum yapmak yerine, aslında neyin eksik olduğuna baktım ve ek bölümlerimi wsi.xml dosyasına ekledim. Düzeltilmesi gereken dosya yönünde beni işaret ettiği için Juanma R.'ye teşekkürler.

catalogProductAttributeCreate öğelerini, bunu düzeltmek için başka bölümlerin bulunması gerekebileceği için bir başvuru noktası olarak atıfta bulunuyorum. WSDL hakkında hiçbir şey bilmiyorum, eksik olanı aramayı denedim.

Dosyayı değiştirdikten sonra Magento'daki tüm önbellekleri yeniledim ve yeni girişlerin WSDL dosyasında /index.php/api/v2_soap?wsdl=1 adresinde gösterildiğini doğruladım. Daha sonra VS 2010'a eklenen web referansını kaldırdım ve web referansını tekrar ekleme adımlarını attım. Bu sefer ekledikten sonra hatam yok.

Düzeltme işleminde bulunduğum Magento sürümü, Magento Enterprise 1.12.0.2'dir, ancak bunun, catalogProductAttributeRemove ile aynı hatayı gösteren diğer sürümleri için geçerli olmasını beklerim.

*** 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

Ben sürümü 1.7.2 dan wsi.xml içine diff dahil ve onu here yüklendi: İşte

ben wsi.xml dosyasında değişti ne koştu hızlı bir fark olduğunu.

Bu nedenle, doğruyu okuyamazsanız, bu dosyayı doğrudan kullanabilirsiniz.