[jboss-user] [Beginners Corner] - First webservice
Renani
do-not-reply at jboss.com
Wed Apr 15 10:39:16 EDT 2009
Hi,
I'm trying to create a webservice. I followed the tutorials at http://www.javabeat.net/articles/40-creating-webservice-using-jboss-and-eclipse-europa-1.html.
The server would not run the war file created by following these steps. I've debugged all day but could not find the reason for it. What I figured out was that the WSDL file was not created. Strangely, the index.html, a static web page I've created for test would not run either.
In the book "JBoss in Action", chapter 9 I read that wsprovide is the program used to generate wsdls and it could be used manually. I attempted to do so and I think I figured out where it all fails. The message I got in Dos prompt is:
Error: Could not generate. (use --show-traces to see full traces)
| java.lang.StringIndexOutOfBoundsException: String index out of range: -1
| at java.lang.String.substring(String.java:1768)
| at org.jboss.wsf.common.JavaUtils.getPackageName(JavaUtils.java:533)
| at org.jboss.ws.metadata.wsdl.WSDLUtils.getTypeNamespace(WSDLUtils.java:
| 700)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.pr
| ocessWebService(JAXWSWebServiceMetaDataBuilder.java:313)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.bu
| ildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:107)
| at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProv
| iderImpl.java:108)
| at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProv
| iderImpl.java:124)
| at org.jboss.wsf.spi.tools.cmd.WSProvide.generate(WSProvide.java:183)
| at org.jboss.wsf.spi.tools.cmd.WSProvide.main(WSProvide.java:76)
The java code I'm trying to generate wsdl for is:
| import javax.jws.WebService;
| import javax.jws.WebMethod;
|
| @WebService
| public class Greeting
| {
| @WebMethod
| public String greetClient(String userName)
| {
| return "Greeting " + userName + "! Have a nice day...";
| }
| }
|
I'm certain that there is an error, not perhaps in the code it self but maybe with my configuration of eclipse (or is it JBoss)?
Would be grateful for any help!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225658#4225658
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225658
More information about the jboss-user
mailing list