How to view WSDL on a JAX-WS web service running under Glassfish?

荒凉一梦 提交于 2019-12-11 07:49:59

问题


How can I view the WSDL of my JAX-WS web service if I'm running it under Glassfish? I know I can generate the WSDL file using wsgen, but I'm want to know if I can have a runtime WSDL on Glassfish?

I've tried running my web service on Tomcat and I was able to get a runtime WSDL by accessing the URL pattern I specified on web.xml. However, since I don't have a web.xml on my JAX-WS web service on Glassfish, I'm not sure how I'm going to access my WSDL.


回答1:


As long as you know the endpoint URL of your web service you should be able to view the runtime WSDL by appending ?wsdl to the end of the URL.




回答2:


  1. Start the GlassFish server (E.g.: from the Servers tab in Eclipse).
  2. Navigate to GlassFish Console (E.g.: http://localhost:4848/common/index.jsf)
  3. On the left side, click on Applications
  4. On the right side, click on the project name
  5. In the Modules and Components section, click on View Endpoint in the Action column
  6. Click on the WSDL value (E.g.: /Test/MyClassService?wsdl - now you are in http://localhost:4848/common/applications/webServiceWsdl.jsf?appName=Test&wsdl=%2FTest%2FMyClassService%3Fwsdl)
  7. Now you can 2 see links (for HTTP and HTTPS). Click on the first one (E.g.: http://localhost.localdomain:8080/Test/MyClassService?wsdl) and you will see the WSDL file.


来源:https://stackoverflow.com/questions/12669835/how-to-view-wsdl-on-a-jax-ws-web-service-running-under-glassfish

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