以WS-I遵从模式生成Web Service客户端 [英] Generate a Web Service Client in WS-I compliance mode

查看:86
本文介绍了以WS-I遵从模式生成Web Service客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试使用Visual Studio 2010创建Web服务客户端. 如果我在SOAP V2版本中使用wsdl文件,则客户端可以很好地工作.
当我在Magento中将属性WS-I Compliance设置为Yes并在VS2010中重新编译Web服务客户端时,它不起作用!一些方法从生成的WSDL文件中消失.


I'm trying to create a web service client using Visual Studio 2010. The client works very well if I use the wsdl file in version SOAP V2.
When I set the property WS-I Compliance to Yes in Magento and recompile the web service client in VS2010, it doesn't work!!! Some methods disappear from the resulting WSDL file.

如果使用工具wsimport生成Java Web Service客户端,则会发现相同的问题.
知道发生了什么吗?

I've found the same problem if I generate a java web service client using the tool wsimport.
Any idea of what's happening?

推荐答案

我遇到了同样的问题,而不是注释掉catalogProductAttributeRemove,实际上我调查了缺少的内容,并将其他部分添加到了wsi.xml文件中.感谢Juanma R.向我指出了需要纠正的文件的方向.

I ran into the same issue and instead of commenting out the catalogProductAttributeRemove, I actually looked into what was missing and added the additional sections to my wsi.xml file. Thanks to Juanma R. for pointing me in the direction of the file that needed to be corrected.

我引用了catalogProductAttributeCreate的条目作为可能需要解决此问题的其他部分的参考点.我真的对WSDL一无所知,只是尝试寻找可能缺少的东西.

I referenced the entries for catalogProductAttributeCreate as a reference point for what other sections might need to exist to fix this. I don't really know anything about WSDL, just tried looking for what could be missing.

更改文件后,我刷新了Magento中的所有缓存,并确认新条目已显示在WSDL文件中的/index.php/api/v2_soap?wsdl=1处.然后,我删除了已添加到VS 2010的Web参考,并完成了再次添加Web参考的步骤.这次添加完之后,我没有任何错误.

After I changed the file I refreshed all caches in Magento and confirmed the new entries were showing up in the WSDL file at /index.php/api/v2_soap?wsdl=1. I then removed the web reference that was added to VS 2010 and went through the steps of adding the web reference again. This time after adding it I got no errors.

我正在修补的Magento版本是Magento Enterprise 1.12.0.2,但我希望它适用于其他在catalogProductAttributeRemove中显示相同错误的版本.

The version of Magento that I was patching is Magento Enterprise 1.12.0.2 but I expect it's applicable to other versions that show this same error with catalogProductAttributeRemove.

以下是我快速浏览过的wsi.xml文件中所做的更改:

Here is a quick diff I ran of what I changed in the wsi.xml file:

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

这篇关于以WS-I遵从模式生成Web Service客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆