web-services – 以WS-I合规模式生成Web服务客户端

前端之家收集整理的这篇文章主要介绍了web-services – 以WS-I合规模式生成Web服务客户端前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用Visual Studio 2010创建Web服务客户端.
如果我在版本SOAP V2中使用wsdl文件,客户端工作得很好.
当我在Magento中将属性WS-I Compliance设置为Yes并在VS2010中重新编译Web服务客户端时,它不起作用!某些方法生成的WSDL文件中消失.

如果我使用工具wsimport生成一个java Web服务客户端,我发现了同样的问题.

知道发生了什么事吗?

解决方法

我遇到了同样的问题,而不是注释掉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显示相同错误的其他版本.

这是我在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>
原文链接:https://www.f2er.com/html/242429.html

猜你在找的HTML相关文章