users@glassfish.java.net

Re: [WebService] Cannot see WSDL or test my WebService

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Tue, 17 Oct 2006 13:33:30 -0700

Antonio Goncalves wrote:

> 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>
>
Two solutions:

Sol 1: When you want to use it as jax-ws standalone deployment(ie
sun-jaxws.xml, use 2.4 version in web.xml). This is just like anyother
web/servlet application. You should see the WSDL in the browser. The URL
would be something like http://.../warfile/validation?wsdl. See in the
server logs if there are any exceptions while deploying. But you won't
see this app in admin console cannot test it without writing a client.

Sol 2: Since you are using 2.5 web.xml, glassfish is trying to deploy
using 109 deployment(It doesn't use sun-jaxws.xml). Looks like this is
failing for some reason. See the server logs if there are any exceptions.

Jitu


> 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
>
>
>
>
>
>
>