WSDL Requests with Metro/JAX-WS/WSIT During Runtime

*爱你&永不变心* 提交于 2019-12-06 14:54:46

问题


During runtime, JAX-WS fetches the WSDL of a SOAP endpoint even though it already ran wsimport in the IDE. This behavior is illustrated here: http://jax-ws.java.net/faq/index.html#wsdl_at_runtime

Is there a limit to amount of metadata that a client can retrieve during runtime? If so, is there a way to increase this limit?

Please note that I am not referring to running wsimport inside the IDE; that works fine. I'm specifically talking about fetching the WSDL metadata during runtime.


回答1:


After many long hours spent on this problem, we came up with a solution. I was working in a Glassfish environment with Metro in Netbeans. If we copied the WEB-INF to the source packages folder everything worked. The java runtime could now bind to the relative path in the jaxws-catalog.xml file. Without copying that folder, it wouldn't work.




回答2:


Metro/JAX-WS-ri needs the WSDL at runtime, period. See http://jax-ws.java.net/faq/index.html#wsdl_at_runtime for an explanation.

To prevent WSDL fetch at runtime you should package it as a resource and provide it when instanciating the proxy factory :

new XYZ_Service( XYZ_Service.class.getResource( "/path/to/your/XYZ.wsdl" ), new QName( "NameSpace", "ServiceName" ) );



回答3:


Based on the fact that you refer to the Metro FAQ, you obviously have read about the reasons as to why a copy of the WSDL is still needed at runtime. To reiterate the FAQ, the reason is to be able to support WS-* extensions that have no corresponding Java annotations.

There is currently no possibility in Metro to disable support for extensions and as a consequence no way to bypass the need for a WSDL at runtime.



来源:https://stackoverflow.com/questions/4315229/wsdl-requests-with-metro-jax-ws-wsit-during-runtime

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