[英]Delegate Axis2 WSDL generation to the JAX-WS RI?
I have a very simple JAX-WS + JAXB SOAP service that I am, by nature of my employment, forced to deploy via Axis2. 我有一个非常简单的JAX-WS + JAXB SOAP服务,根据我的工作性质,我不得不通过Axis2进行部署。
If I take my JAXB classes and my service class, and deploy them via the JAX-WS reference implementation baked into the JDK, eg 如果我使用我的JAXB类和我的服务类,并通过JDK中提供的JAX-WS参考实现来部署它们,例如
public static void main(final String... args) {
Endpoint.publish("http://0.0.0.0:9090/MyService", new MyService());
}
The RI (2.2.4, JDK7) generates a beautiful, standards-compliant WSDL that can be consumed by pretty much any tool (soapUI, etc.). RI(2.2.4,JDK7)生成漂亮的,符合标准的WSDL,几乎任何工具(soapUI等)都可以使用它。
If I take the very same classes and deploy them via a services.xml file in Axis2, eg 如果我采用相同的类,并通过Axis2中的services.xml文件部署它们,例如
<service name="MyService" scope="soapsession" targetNamespace="http://com.service.my">
<Description>My Service Endpoint</Description>
<messageReceivers>
<messageReceiver class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver" mep="http://www.w3.org/2004/08/wsdl/in-out"/>
</messageReceivers>
<!-- <parameter name="useOriginalwsdl">true</parameter> -->
<parameter locked="false" name="ServiceClass">com.service.my.MyService</parameter>
</service>
Axis2's WSDL generation takes over and generates complete garbage that's unusable by pretty much any tooling. Axis2的WSDL生成将接管并生成完整的垃圾 ,几乎所有工具都无法使用这些垃圾 。
I know that I can uncomment the <parameter name="useOriginalwsdl">true</parameter>
line in my services.xml and provide a static WSDL, but doing so forces me to keep the WSDL updated manually in the future, which I would prefer to avoid. 我知道我可以在我的services.xml中取消注释
<parameter name="useOriginalwsdl">true</parameter>
行并提供静态WSDL,但是这样做会迫使我将来手动保持WSDL更新,而我会宁愿避免。
Is there any way to deploy my service via Axis2 and have the WSDL generated, but circumvent Axis2's abysmal WSDL generation and delegate that to the JAX-WS RI? 有什么方法可以通过Axis2部署我的服务并生成WSDL,但是可以绕开Axis2糟糕的WSDL生成并将其委托给JAX-WS RI?
It turns out that this is not possible without modifying or hooking into Axis2's implementation, which obviously creates a maintenance problem later on. 事实证明,如果不修改或插入Axis2的实现,这是不可能的,这显然会在以后造成维护问题。 As such, I guess I will just live with the crappy WSDLs that Axis2 generates.
因此,我想我将只使用Axis2生成的糟糕的WSDL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.