?
Solved

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

Posted on 2005-04-14
9
Medium Priority
?
188 Views
Last Modified: 2010-03-31
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?
0
Comment
Question by:tbarrawi
  • 5
  • 4
9 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 13786169
Put the class you want to load in the WEB-INF/classes dir
0
 

Author Comment

by:tbarrawi
ID: 13786282
Great. Thanks CEHJ
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13786295
:-)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:tbarrawi
ID: 13791865
CEHJ,  what if the classes I have were in a package.  putting them under WEB-INF/classes/packagename didnt work
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13791896
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
 

Author Comment

by:tbarrawi
ID: 13791947
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 13792037
>>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
 

Author Comment

by:tbarrawi
ID: 13792084
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 13792118
>>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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question