Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Depolying Web Services  RSS feed

 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am pretty new to the AXIS world and am giving Web Services a run through for a project at school. I am creating a simple service that takes in an object and can perform operations on the object. I wrote the object and service classes and did Java2WSDL. I ended up with the .wsdl file that I want to put on the Axis (Tomcat) server so others can view it. I then did WSDL2Java on the .wsdl and got a bunch of WS classes and (un)deploy.wsdd. I tried to deploy the service using AdminClient and it is not working for some reason. Any suggestions?
 
Kruger Brent
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you're trying to deploy the service on axis-engine running under Tomcat (as web application). If so, where is the tomcat running (local/remote)? Also, post the error/exception message here.

FYI: By deault, you cannot deploy a service on tomcat running remotely. For this, in <tomcat-home>/webapps/axis/WEB-INF/server-config.wsdd file, you have to set the parameter "enableRemoteAdmin" to true.

Hope this helps.
 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with Axis on a local Tomcat server. At this point what I am trying to accomplish is to create a simple service that takes in a String or an int as a parameter, and perform a function on it. Now, when i create the service that takes in a String parameter, it deploys (using a .wsdd deployer) and works fine. I undeployed the service, altered it so that it now takes in an int as the parameter, changed the client so that it parameter.in is now an XSD_INT, and I continuously get an error that says Bad Type (int --> java.lang.String). When I look at the deployed WSDL, it say that the request message requires an String as the input parameter. I tried altering the name of the service because I thought maybe it was being cached someway, somehow...but I got the same error. Now my goal is to eventually pass an object into the service, but I am taking baby steps at this point.

Any thoughts on this problem?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beyond undeploying the old WS and deploying the new one, you also need to stop and restart the Axis web app. That's because the classes of the WS are not removed from the classloader by undeploying, so if any has changed as in your case, it will not be picked up.
 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried to restart Tomcat after I undeploy the WS and remove the classes from the WEB-INF/classes dir. Is there something else I need to do?
 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me spell out the steps I am going through to get a WS deployed to see what my problem is. I am creating a service with Java code and compiling the source. I then start my Tomcat server and deploy my service and it works fine. I then undeploy the service and stop Tomcat completely. I change the service around bu taking in an int instead of a String, and follow the same steps as before. Now, I get ClassNotFound when it found the same service 2 minutes ago. I am doing something fundamental wrong and I have no idea what it is. My classpath point to axis within my tomcat/webapps directory. Is this right? Any help or direction would be excellent...thanks in advance.
 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention in the steps above that every time I compile the WS, I move the classes into the axis/WEB-INF/classes dir.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like it should work. As long as you stop and restart the Axis web app each time you copy new classes to the WEB-INF directory, it should pick them up OK. (You don't need to stop Tomcat completely, by the way - just restarting Axis is sufficient.)

If you deploy the WS, you can check whether the changes are saved properly by looking at the server-config.wsdd file in the Axis/WEB-INF directory. It contains all the deployment information.
 
Scott Branchini
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I check the server-config.wsdd file and it shows the service. It looks as though the deploy.wsdd "works" fine, but then when I try to use the service, I get a error because it cannot locate the class file of the particular service. I dont understand why it is not picking up the changes and recognizing the new classes. Besides the WEB-INF/classes dir, is there any other place that the .class files should go? Can something be wrong with my classpath? The examples from the Apache Axis site seem to work fine up to this point.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!