Java .Net 互操作。轴 java.util.Map

发布于 2024-08-15 11:01:14 字数 1348 浏览 8 评论 0原文

我有 wsdl 需要由 wsdl.exe (.net sdk 2.0) 解释 该 wsdl 是由 axis 引擎在运行时生成的,它正在读取 wsdd 文件来生成它。

我的返回类型之一内部有 java.util.Map,这里是 wsdl 中映射的架构(只是 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 时,我收到以下错误;

  • 无法导入操作“getXXX”。
  • 类型必须在架构的顶层声明。请查看 命名空间中的模式类型“Map” 'http://xml.apache.org/xml-soap': 元素“item”正在使用匿名类型 声明,匿名类型不是 通过编码的 SOAP 支持。

这是否意味着我不能使用地图作为网络服务?我对谷歌的结果不满意......

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

緦唸λ蓇 2024-08-22 11:01:14

让我回答我自己的问题;
如果您想让 .NET 使用您的 Web 服务,则不应使用 java.util.Map 作为返回类型
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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文