• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis wsdl2java overwriting class files

 
Todd Farmer
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm just beginning to work through web services, and I'm having a difficult time. I created a test business object (com.greenbuildingpages.services.DistanceCalculator) and ran java2wsdl against it:

java org.apache.axis.wsdl.Java2WSDL -o wp.wsdl -l"http://localhost:8080/axis/services/distance" -n "urn:Example" -p"com.greenbuildingpages.services" "urn:Example" com.greenbuildingpages.services.DistanceCalculator

This created the wdsl file:



I then ran wsdl2java against this generated wsdl document:

java org.apache.axis.wsdl.WSDL2Java -o ./main/src/java -d Session -s -S true -Nurn:Example com.greenbuildingpages.services wp.wsdl

When this completed, I had the additional artifacts that I was expecting (DistanceCalculatorService,java, DistanceCalculatorServiceLocator.java, etc.). But my original DistanceCalculator.java file had been modified (into an interface).

I'm sure I likely have the command line arguments mixed up. Can somebody help me or point me towards their favorite Axis tutorial that might help me through this?

Thanks!

Todd Farmer

[ July 06, 2005: Message edited by: Todd Farmer ]

[ July 06, 2005: Message edited by: Todd Farmer ]
[ July 08, 2005: Message edited by: Todd Farmer ]
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no expert, but sounds like you're doing it right - what you want to do is specify a different output directory for the generated files. I'm not sure of the command line option (-o, probably, which you already use), but the wsdl2java Ant task can be used like this:



In general, with Web services (regardless of the Java toolkit used) I find it necessary to:

  • Keep the client and server bindings in separate directories (or in separate JARs).
  • Never put the two directories/JARs on the same classpath, when compiling or running the client or server application. Only put the server JAR/dir on the server classpath, etc. This prevents the inevitable namespace clashes (if the same packages are used).
  • Have neither on the classpath when regenerating the binding files themselves (e.g., when running wsdl2java). On some platforms (e.g., Weblogic) having one on the classpath produces *baffling* errors.


  • I also find it simplifies things if you generate the client bindings into a different package than the server ones. E.g., org.jacksonwest.travel.client.binding for the client, and org.jacksonwest.travel.server.binding for ther server.

    -Tim

    [edit: it might be nice to edit your post and shorten that massive line that makes this thread so hard to read...]
    [ July 06, 2005: Message edited by: Tim West ]
     
    Todd Farmer
    Ranch Hand
    Posts: 59
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for the help and for the suggestions!
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!