- This topic has 1 reply, 1 voice, and was last updated 18 years, 4 months ago by Roel De Nijs.
-
AuthorPosts
-
Roel De NijsMemberI followed the example (bottom-up scenario) described in the “New And Noteworthy”-section. I changed in both generated files the method-name.
I deployed it to Tomcat 5 and started the web services explorer. I entered the url to WSDL and clicked on go. I was amazed to see it working 🙂Then i saved the wsdl-file to my local drive and started a top-down scenario, which generated some classes. Then i tried to make a TestService-class
public class TestService { /** * @param args de command-line argumenten */ public static void main(String[] args) { if (args.length != 1) { throw new IllegalArgumentException("Juist 1 argument meegeven aub!"); } HalloServiceClient service = new HalloServiceClient(); System.out.println(service.getHalloServiceHttpPort().zegHallo(args[0])); } }
and tried to run it. but it gave me some error (something like endpoint doesn’t exist).
so i tried again and again and now when i start my tomcat, i got following error
2006-07-11 14:50:09,902 - Installing web application at context path /WS01ME from URL file:C:\Program Files\Apache Software Foundation\Tomcat AG4W\webapps\WS01ME 2006-07-11 14:50:10,762 - Loading XML bean definitions from class path resource [org/codehaus/xfire/spring/xfire.xml] 2006-07-11 14:50:11,141 - Loading XML bean definitions from class path resource [org/codehaus/xfire/spring/customEditors.xml] 2006-07-11 14:50:11,191 - JDK 1.4+ collections available 2006-07-11 14:50:11,221 - Commons Collections 3.x available 2006-07-11 14:50:12,020 - Loading XML bean definitions from class path resource [META-INF/xfire/services.xml] 2006-07-11 14:50:12,030 - Error initializing XFireServlet. org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/xfire/services.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:137) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:167) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148) at org.codehaus.xfire.spring.XFireConfigLoader.getXFireApplicationContext(XFireConfigLoader.java:99) at org.codehaus.xfire.spring.XFireConfigLoader.loadContext(XFireConfigLoader.java:39) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.loadConfig(XFireConfigurableServlet.java:75) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.createXFire(XFireConfigurableServlet.java:51) at org.codehaus.xfire.transport.http.XFireServlet.init(XFireServlet.java:45) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
how do i solve this one? (i already tried redploying but with no success)
Roel De NijsMemberi deleted the project (without deleting the contents) and created it back, and now everything works fine
i’m happy with my first succesful web service 🙂
but could you tell me what steps i have to follow to create webservice + ability to test it (via own code, not the web services explorer).
i did the following:
– create a webservice with the bottom-up scenario and deployed it
– started my application server (tomcat 5)
– opened the web services explorer and typed in the link to wsdl
– then tested it out and select the first line under “WSDL Main”
– then i clicked on “import wsdl to file system” and saved it on disk
– then created a new webservice with the top-down scenario and selected the wsdl-file. everything was generated and i’m able to compile and run the following code:public class TestService { /** * @param args de command-line argumenten */ public static void main(String[] args) { if (args.length != 1) { throw new IllegalArgumentException("Juist 1 argument meegeven aub!"); } HalloServiceClient service = new HalloServiceClient(); System.out.println(service.getHalloServiceHttpPort().zegHallo(args[0])); } }
i already found an alternative:
– instead of clicking “import wsdl to file system” i clicked on “start web services wizard” and then select “web service client” and click on go
– then make some choices and click finish
– and then i’m able to create following test-programpublic class TestService { /** * @param args de command-line argumenten */ public static void main(String[] args) throws Exception { if (args.length != 1) { throw new IllegalArgumentException("Juist 1 argument meegeven aub!"); } HalloServiceLocator service = new HalloServiceLocator(); System.out.println(service.getHalloServiceHttpPort().zegHallo(args[0])); } }
so the one class calls HalloServiceClient and the other HalloServiceLocator
which of both ways is the preferred way of working? or is there another one, that’s better, easier, faster,…?
-
AuthorPosts