问题描述
我正在尝试为Microsoft的MSDN服务创建Web服务客户端( MSTP内容服务).当我使用本地IDE生成类时,它无法解析Microsoft的WSDL,其发布在 http://services.msdn.microsoft.com/ContentServices/ContentService.asmx?wsdl ,所以我尝试使用中性"验证器( XMethods WSDL验证程序),而XMethods验证程序则表示无法在没有更多重要信息的情况下进行解析.我还尝试了 eXtc验证器,并遇到了类似的解析失败.如何克服此错误并为MSTP创建Web服务客户端?
I am trying to create a web services client for Microsoft's MSDN service (MSTP Content Service). When I use my local IDE to generate the classes it is failing to parse the WSDL from Microsoft published at http://services.msdn.microsoft.com/ContentServices/ContentService.asmx?wsdl and so I tried validating it with a "neutral" validator (XMethods WSDL Validator) and the XMethods validator is saying it cannot parse it with no further significant information. I also tried the eXtc validator and got a similar parse failure. How can I get past this error and create a web services client for MSTP?
推荐答案
我需要代码存根才能与MS Content Service系统进行通信.我使用了Apache CXF,它提供了用于生成Java或Corba存根的工具. Apache CXF因属性拼写错误("messsage"
的3 s而不是2 s)而失败:
I needed code stubs in order to communicate with the MS Content Service System. I used Apache CXF which provides tools for generation of Java or Corba stubs. Apache CXF failed because of a misspelled attribute ("messsage"
with 3 s instead of 2):
...
<wsoap12:header messsage="this:AppID" part="AppID" user="literal"/>
...
正式描述文件的下载(以及错误拼写的属性名称的更正)未成功,因为存根生成还需要其他文件.我下载了所有丢失的14个文件.
A download of the formal description file (and correction of misspelled attribute name) wasn't successful because there are further files required for stub generation. I download all missing 14 files.
您可以下载WSDL描述文件并对该文件执行Apache CXF存根生成.该脚本将中止并打印丢失的文件.因此,您必须手动下载此文件,然后重新开始生成,由于进一步丢失文件,该生成可能会中止几次.您可以在Web服务器上的schemas
文件夹中找到此文件,例如:
You could download the WSDL description file and execute the Apache CXF stub generation on this file. This script will abort and print the missing file. So, you have to download this file, manually, and to restart the generation which may abort several times because of further missing files. You can find this files in the schemas
folder on the web server, e.g.:
http://services.msdn.microsoft.com/ContentServices/schemas/urn_mtpg_com_mtps_2004_1_image_category_atoms.xsd
http://services.msdn.microsoft.com/ContentServices/schemas/urn_msdn_com_public_content_syndication_2006_09_common.xsd
...
重复下载它们并将其放入WSDL描述文件附近的schemas文件夹中.
Repeatedly download them and put them into a schemas folder near your WSDL description file.
这篇关于MSDN Web服务WSDL无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!