问题
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:
- Start the GlassFish server (E.g.: from the Servers tab in Eclipse).
- Navigate to GlassFish Console (E.g.: http://localhost:4848/common/index.jsf)
- On the left side, click on Applications
- On the right side, click on the project name
- In the Modules and Components section, click on View Endpoint in the Action column
- 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) - 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