不带参数的 getter 的 WSDL 类型 [英] WSDL Type for getter without parameter
问题描述
我尝试编写一个 wsdl 文件.我首先在元素中定义我未来的操作.所以我需要定义一个像 getAllObjects 这样的方法.这就是为什么我不需要为 getAllObjectsRequest 设置任何参数.谁能告诉我我必须如何为不声明任何输入参数(如 getById 中的 ID)的方法定义我的消息和操作.
I try to write a wsdl file. And I start with defining in the element my future operations. So I need to define a method like getAllObjects. That's why I don't need to set any parameter to getAllObjectsRequest. Could anybody tell me how I must define my message and operations for a method which doesn't declare any inputparameters (like ID in getById).
目前我有下一个代码:
<type .....>
<xsd:element name="getAllObjectRequest">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getAllObjectResponce">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="allObject" type="wsbean:ObjectADB"
minOccurs="0" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
我认为这不正确.
谢谢.
推荐答案
这个语法是正确的.如果您不喜欢它,我建议为此类消息创建特殊标记 Void
类型:
This syntax is correct. If you don't like it, I suggest creating special marker Void
type for these kind of messages:
<xsd:element name="getAllObjectRequest" type="Void"/>
<xsd:complexType name="Void">
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
注意 SOAP 消息中的有效请求如下所示:
Note that valid request in SOAP message look like this:
<getAllObjectRequest/>
这篇关于不带参数的 getter 的 WSDL 类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!