Java .Net Interop. Axis java.util.Map

回眸只為那壹抹淺笑 提交于 2019-12-08 05:22:43

问题


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.

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>

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

  • 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.

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


回答1:


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



来源:https://stackoverflow.com/questions/1944490/java-net-interop-axis-java-util-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!