我正在將.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