can a webservice make a call to a regular local java class?

Hi, I do have two java classes. Class1 and Class2.  Class1 calls class2. I want to convert Class1 to a webservice so I have installed Apache Axis and renamed the Class1.java to Class1.jws but getting erros can't fnd Class2 although I put the compiled class2 in the same axis dir as Class1.jws

My question is possible to do what I am trying to do? Having Class1 as a webservice while it uses Class2?
tbarrawiAsked:
Who is Participating?
 
CEHJCommented:
Put the class you want to load in the WEB-INF/classes dir
0
 
tbarrawiAuthor Commented:
Great. Thanks CEHJ
0
 
CEHJCommented:
:-)
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
tbarrawiAuthor Commented:
CEHJ,  what if the classes I have were in a package.  putting them under WEB-INF/classes/packagename didnt work
0
 
CEHJCommented:
It should do.

1. In your source code:

package x;

what is 'x'?

2. What is the full path under WEB-INF/classes where it resides?
0
 
tbarrawiAuthor Commented:
package myservice;

and the full path is WEB-INF/classes/myservice/

the webservices itself doesn't include any package name correct.

let me try again maybe i misstyped something...
0
 
CEHJCommented:
>>the webservices itself doesn't include any package name correct.

Not sure what you mean by that. Any class using it that's not in the same package will have to import it as normal or refer to it by the  FQ class name
0
 
tbarrawiAuthor Commented:
the class1.jws file under the axis main direct will not have the  package myservice; only the other classes under the EB-INF/classes/myservice/ should. correct?
0
 
CEHJCommented:
>>will not have the  package myservice

I'm not sure what you mean by that. Classes are loaded via the classpath and the pacakges relate to directory structures in relation to that classpath (or paths in the classpath)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.