Java的.NET互操作程序。轴的java.util.Map操作、程序、NET、Java

2023-09-04 05:12:36 作者:∞ 装疯总比装β好 っ

我有WSDL,需要由Wsdl.exe用PTED除$ P $(.NET SDK 2.0) 此WSDL是在运行时通过轴发动机产生的,它被读取WSDD文件来生成此。

I have wsdl that needs to be interpreted by wsdl.exe (.net sdk 2.0) This wsdl is generated on runtime by axis engine, and it is reading a wsdd file to generate this.

我的一个返回类型具有的java.util.Map内,这里是在WSDL地图(WSDL只是其中的一部分)

One of my return types have java.util.Map inside and here is the schema for a map in wsdl (just one part of wsdl)

<schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
    		<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    		<complexType name="Map">
    			<sequence>
    				<element maxOccurs="unbounded" minOccurs="0" name="item">
    					<complexType>
    						<all>
    							<element name="key" type="xsd:anyType" />
    							<element name="value" type="xsd:anyType" />
    						</all>
    					</complexType>
    				</element>
    			</sequence>
    		</complexType>
    	</schema>

但是,当我运行Wsdl.exe用读这个WSDL我收到以下错误;

But when I run the wsdl.exe to read this wsdl I am getting following error;

  无法导入操作的getXXX。   类型必须在架构中的顶级声明。请查看   从命名空间的架构类型地图    http://xml.apache.org/xml-soap :   元素'项目'是使用匿名类型   报关,匿名类型不   有连接codeD SOAP支持。    Unable to import operation 'getXXX'. Types must be declared at the top level in the schema. Please review schema type 'Map' from namespace 'http://xml.apache.org/xml-soap': element 'item' is using anonymous type declaration, anonymous types are not supported with encoded SOAP.

这是否意味着我不能使用地图,当谈到Web服务?我不能满足于谷歌的结果......

Does this mean that I am not allowed to use Map when it comes a web service? I couldn't be satisfied with google results...

推荐答案

让我来回答我的问题; 你不应该使用的java.util.Map作为返回类型,如果你想通过.NET ,使您的网络服务耗材 http://wiki.apache.org/ws/FrontPage/Axis/DotNetInteropMapInfo

Let me answer my own question; You should not use java.util.Map as a return type if you want to make your web services consumable by .NET http://wiki.apache.org/ws/FrontPage/Axis/DotNetInteropMapInfo