users@glassfish.java.net

[WebService] Cannot see WSDL or test my WebService

From: Antonio Goncalves <antonio.mailing_at_gmail.com>
Date: Tue, 17 Oct 2006 21:56:18 +0200

Hi,

I've developed a simple WebService and I'm trying to test it with the admin
console but can't (Glassfish V2bv21). The admin console display a "null"
link for the WSDL file and clicking on "Test" opens a popup window with the
right menu of the admin console on it... that's all.

I don't know what I'm doing wrong. Here are my steps :

1 - Develop a simple web service

@WebService
public class Validation {

    @WebMethod(operationName = "ValidateCard")
    @WebResult(name = "isCardValid")
    public boolean validateCreditCard(@WebParam (name="creditCardNumber")
String ccNumber,
                                      @WebParam (name="creditCardType")
String ccType,
                                      @WebParam (name="expiryDate") String
ccExpiryDate) {

     (...) business code (...)

}
2 - Generate artifacts with WSGen (I have to say i got a bit confused
because I didn't know if I had to use apt or wsgen). I get
ValidateCreditCard.java and ValidateCreditCardResponse.java classes
3 - Package all these 3 classes with web.xml and sun-jaxws.xml into a war
file
--> sun-jaxw.xml
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0
'>
    <endpoint
            name='ValidationService'
            implementation='com.barkbank.validator.Validation'
            url-pattern='/validation'/>
</endpoints>
--> web.xml

<web-app version="2.5" (...) >

    <listener>
        <listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
    </listener>
    <servlet>
        <servlet-name>ValidationService</servlet-name>
        <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ValidationService</servlet-name>
        <url-pattern>/validation</url-pattern>
    </servlet-mapping>
</web-app>
4 - and deploy. I can see my web app and WebService in the console... but I
cannot test it or see the wsdl file.

What am I doing wrong ?

Thanks,

Antonio