1 Reply Latest reply on Mar 3, 2005 11:29 AM by Andrew Wagg

    help w/ web service

    William Newbie

      I'm trying to build a service according to the wiki and the error output below says I need a "WSDL-based configuration file". Isn't that what the config.xml file is? I've include that. Anyone see anything wrong w/ what I have?

      build.xml

       <path id="classpath.jwsdp">
       <fileset dir="${home.jwsdp}">
       <include name="*.jar"/>
       </fileset>
       </path>
      
       <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
       <classpath refid="classpath.jwsdp"/>
       </taskdef>
      
       <target name="compilews">
       <wscompile
       keep="true"
       import="true"
       base="${proj.temp}/classes"
       xPrintStackTrace="true"
       verbose="false"
       classpath="${classpath.jwsdp}"
       config="${proj.etc}/config.xml">
       </wscompile>
       </target>
      


      config.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
       <service name="FoodIF_Service"
       targetNamespace="http://localhost.org/wsdl"
       typeNamespace="http://localhost.org/types"
       packageName="stub_tie_generator_test">
      
       <interface name="stub_tie_generator_test.FoodIF"
       servantName="stub_tie_generator_test.FoodImpl"/>
       </service>
      
      </configuration>
      


      FoodIF_Service.java
      public interface FoodIF_Service extends java.rmi.Remote
      {
      
       public String getFood(String Food) throws java.rmi.RemoteException;
      }
      

      build output
      compilews:
      [wscompile] class javax.xml.rpc.holders.Holder not found.
      [wscompile] at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.<init>(RmiModeler.java:142)
      [wscompile] at com.sun.xml.rpc.processor.config.RmiModelInfo.getModeler(RmiModelInfo.java:64)
      [wscompile] at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
      [wscompile] at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
      [wscompile] at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
      [wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
      [wscompile] at com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:746)
      [wscompile] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [wscompile] at org.apache.tools.ant.Task.perform(Task.java:364)
      [wscompile] at org.apache.tools.ant.Target.execute(Target.java:341)
      [wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [wscompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)[wscompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
      [wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:673)
      [wscompile] at org.apache.tools.ant.Main.startAnt(Main.java:188)
      [wscompile] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
      [wscompile] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
      [wscompile] error: class javax.xml.rpc.holders.Holder not found.
      
      [wscompile] error: -import requires a WSDL-based configuration file
      
      [wscompile] Command invoked: wscompile -d /home/slash/projects/myProj/build/classes -import -keep -Xprintstacktrace /home/slash/projects/myProj/etc/config.xml -classpath /home/slash/projects/myProj/${classpath.jwsdp}
      


        • 1. Re: help w/ web service
          Andrew Wagg Newbie

          Your wscompile has the import option, this tells wscompile that the classes should be generated from the wsdl specified in your config.xml. Its complaining because it can't find your wsdl file. Check the step by step service WIKI, this isn't using a wsdl file in config.xml or the import option to wscompile.

          Andy