我需要创建一个不应该使用任何参数的Web服务方法。我正在使用jax-ws和apache xref来生成来自wsdl的Java源代码。我不能省略输入消息(发生错误)。这样做的最佳方式是什么?到目前为止,我已经找到了以下解决方案
<message name="getTermRequest" />
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
但你可以建议一些更好的东西吗?
答案 0 :(得分:0)
如果你想修改现有的wsdl文件(这似乎是一个rpc / lit wsdl),那么你所做的方法很好。您无法删除输入消息,因为这会使Web服务仅运行一次。
但是如果你可以从POJO代码(即代码优先)开始,那么你可以用更少的方式编写服务方法参数,让框架生成wsdl。