1

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.

Arci
  • 6,647
  • 20
  • 70
  • 98
  • What JAX-WS implementation do you use? –  Oct 01 '12 at 08:33
  • I'm using the default JAX-WS on Glassfish. For the Tomcat, I downloaded my JAX-WS jars at http://jax-ws.java.net/ . Are they using the same implementation? I'm confused with Metro and the original JAX-WS from Java. I know I'm running my other web service on Glassfish which can be downloaded on Oracle's site. So I'm thinking that the JAXWS from Glassfish is the Java's implementation. However, on the link I provided, you can see that Metro is a subclass of Glassfish. Is Metro an alias of Java's implementation of JAX-WS? – Arci Oct 01 '12 at 08:42
  • 1
    They are the same, Glassfish uses the web service implementations from [Metro](http://metro.java.net/). Metro is the parent project for a number of Web Service related projects including the reference implementation of JAX-WS. – Nick Wilson Oct 01 '12 at 08:52
  • @NickWilson: Thanks! I also posted this question at http://stackoverflow.com/questions/12670261/metro-vs-javas-jax-ws since I think it is a new topic. Can you answer the question on the link I provided? I'm still confused on something. Why is Glassfish using Metro when Java has its own JAX-WS implementation bundled on JDK 6? I thought Glassfish is the standard J2EE server for Java since it's hosted at Oracle site? Please answer my question on the link I provided. Thank again! – Arci Oct 01 '12 at 09:04

2 Answers2

3

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.

Nick Wilson
  • 4,959
  • 29
  • 42
  • 2
    Thanks! Found it. It's my className + "Service" + "?wsdl". I saw the link also inside Glassfish console. I'm having a problem the accessing Glassfish console earlier so I wasn't able to see it. Thanks again! – Arci Oct 01 '12 at 08:46
  • 1
    Also if there is an WebService annotation with serviceName parameter wsdl can be figured as - serviceName + "/" + className + "/" + "?wsdl" – Cherry Sep 27 '13 at 07:09
0
  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.
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199