javax.jws.WebService.wsdlLocation with jboss 4.2.2

一世执手 提交于 2019-12-23 19:02:26

问题


How specifically can you use the javax.jws.WebService.wsdlLocation in JBoss 4.2.2? (This is for an EJB3 bean deployed as a web service).

There is some documentation around that it is supported, but what exactly is the format? I have tried an http, I have tried a relative URL. How does JBoss look for it, a URL, something on the classpath of the EJB, something else?


回答1:


You should take a look at JBWS-2206 and related issues JBWS-1714 and JBWS-1837.

From the information I could gather, JBoss internally uses Metro (the RI) for JAX-WS. I'm not very sure about this, but it appears that Metro reads WSDLs, if provided via the wsdllocation attribute, using the classloader, thereby making META-INF/wsdl of the EJB JAR a safe choice to place WSDLs. The example file in JBWS-2206 would help as a reference.

Update

A thorough overview on how to provide your own WSDL is present in the JBoss forums.

Update #2

The JAX-WS specification, gives a better idea on why this is the case. In the section 5.2.5.3 Use of @WebService(wsdlLocation) and Metadata, one can find the specification stating that

The value of the wsdlLocation annotation element on an endpoint implementation class, if any, MUST be a relative URL. The document it points to MUST be packaged with the application. Moreover, it MUST follow the requirements in section 5.2.5.4 below (”Application-specified Service”).

Furthermore, it states that

A JAX-WS implementation MUST patch the location attributes of all wsdl:import and xsd:import statement in local documents that point to local documents. An implementation MUST NOT patch any other location attributes.

defining how the generated WSDL should appear.



来源:https://stackoverflow.com/questions/1380355/javax-jws-webservice-wsdllocation-with-jboss-4-2-2

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