我正在将.NET应用程序与一个名为Hermes2(H2O)的基于Servlet的Java应用程序进行集成。 Java应用程序公开了几个Web服务,并且我试图在Visual Studio 2008中为这些服务创建Web引用。但是,这只会导致一个空代理服务器,发出以下错误消息:“CODEGEN:操作从命名空间' http://service.ebms.edi.cecid.hku.hk/'被忽略,不支持指定use = literal消息的类型。“在.NET中使用Java Webservice
当我试图通过.NET中的Wsdl.exe用实用程序来运行WSDL,我得到下面的输出:
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
R2204: A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.
- Part 'messageId' of message 'EbmsRequestMsg' from service description with targetNamespace='http://service.ebms.edi.cecid.hku.hk/'.
- Part 'hasMessage' of message 'EbmsResponseMsg' from service description with targetNamespace='http://service.ebms.edi.cecid.hku.hk/'.
For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.
Warning: one or more operations were skipped.
Warnings were encountered. Review generated source comments for more details.
Writing file 'C:\Files\Temp\Helsekortet\Hermes\wsdl\EbmsMessageReceiverDownload.cs'.
有谁知道问题是什么,可能这可怎么固定?我会假设Hermes2使用某种常见的Webservices库。有没有这样的Java库产生无效的WSDL?或者这只是.NET不支持的一些功能?
的WSDL如下(我不能在这里看到的附加文件的任何方式,我没有一个URL到WSDL对不起张贴臃肿的问题。):
<?xml version="1.0" encoding="utf-8"?>
<definitions
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:p="http://service.ebms.edi.cecid.hku.hk/"
targetNamespace="http://service.ebms.edi.cecid.hku.hk/">
<types>
</types>
<message name="EbmsRequestMsg">
<part name="messageId" type="s:string" />
</message>
<message name="EbmsResponseMsg">
<part name="hasMessage" type="s:string" />
</message>
<portType name="EbmsReceiverDownload">
<operation name="Request">
<input message="p:EbmsRequestMsg" />
<output message="p:EbmsResponseMsg" />
</operation>
</portType>
<binding name="EbmsSoapHttpReceiverDownload" type="p:EbmsReceiverDownload">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="Request">
<soap:operation soapAction="Ebmsreceiverdownload" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="EbmsMessageReceiverDownload">
<documentation>Documentation not available.</documentation>
<port name="EbmsReceiverDownload" binding="p:EbmsSoapHttpReceiverDownload">
<soap:address location="http://127.0.0.1:8080/corvus/httpd/ebms/receiver" />
</port>
</service>
</definitions>
希望有人能帮助。
你知道这可以做到吗?我对WSDL并不是很有经验,所以我希望你能给我一些指点。另外我会认为生成这个WSDL的Java Webservice库也应该生成这个呢? – 2009-09-28 12:40:55
这实际上取决于使用哪个Java库来实现web服务。 – 2009-09-29 09:22:13
是的,它当然是。但一个标准是一个标准;谁会实现或使用不生成标准WSDL的web服务库? – 2009-10-01 10:24:37