Hi Lee,

Great,  thanks for reply. I appreciate it.  When I tried to move generated code 
to same disk space I am writing I got an errors as generated packages are not 
recognized as they reflect service providers structure, from your reply it 
seems like I will have edit that code.  

I use Eclipse 3.2, what do you mean by 4th point (adding source code to 
project), do you mean create new classes and copy the code from generated files?

Thanks in advance.

Regards,
Srinis

----- Original Message ----
From: Lee Meador <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, September 19, 2007 2:57:16 PM
Subject: Re: [xfire-user] Consuming services from different application

The generated code has to be on the classpath when you compile the code that 
uses it.

Some alternatives are to:

1) compile the generated code and put it into a jar, which goes on the compile 
and runtime classpaths.

2) move the generated code to the same disk folder space as the code you are 
writing.
3) add to the classpath to point to wherever the generated code is
4) if you are in an IDE like Eclipse or Netbeans (or whatever) there is a way 
to add the generated source code to your project

5) if you are using maven to do the build you want to use the xfire plugin to 
generate the code and add it to the build path\

Thanks.

-- Lee

On 9/18/07, 
srinivas kamisetty <[EMAIL PROTECTED]> wrote:
Hello All,
   
  I am beginning to pick up on xfire. I created my first web service in 
¡°Application A(Service providing application¡±) 
 with java class User.java and implentation class UserImpl.java and was able to 
test it following Tomek's input with success, so far good. I feel like I am 
almost there.  All my web service does is return a simple string that it gets.

   
  Now to the part of consuming the service.  I have to pass this string from 
different ¡°Application B (Service consuming application)¡± . I generated code 
using xFire plugin in Application B that generated following classes.

   
  1. User.java
  
2. UserImpl.java
  3. UserClient.java
  4. UserPortType.java
  
5. UserResponse.java
  6. ObjectFactory.java
  7.
 package-info.java
   
  Here is the problem, ok I downloaded all the above files to folder called "
com.soa" in application B and to default package.  All I need to do now is just 
pass a string to Application A and get it back. I want try something like 
'User.getMeString ("Srini");
  
 
  He is the first probelm, as soon as downloaded above file thru plugin , it 
downloaded with same package declarations as in Applcation A. But my client 
application B doesn't show any errors. 
 I tried to use above classes in my action classes I get errors as my 
Application B doesn¡¯t recognize any of the above classes. My idea
 was to do something like following in my action class to import package where 
I have above classes. When I downloaded to com.soa, it created 
com.soa.com.cma.soa (the bold part is from Application A, do not why that 
happens)

   
  My plan is to do to import above package into my struts action class so I can 
do something like import 
com.soa.com.cma.soa.*; to get access to above classes. But I get error saying 
the package doesn¡¯t exist.
   
  
So my questions are.  How do I use generated classes in my
 consumer application (Application B) to consume and how can I access those 
classes.  If anyone  has sample code to pass a string to a service (of 
different application)  and get it back and how to make generated classes 
available to consuming application I will appreciate it very much.

   
  As of now it seems like it is very easy to generate java classes from wsdl if 
you give url location but it seems like your consuming application doesn't 
recognize any of those as generated classes still have package declaration from 
service provider where as consuming app can't recognize those packages. 

   
  Sorry for long text, I am new to xFire and web services. Hope it all make 
sense.

   
  Regards,
  
Srini
   
 
      
Looking for a deal? 
Find great prices on flights and hotels with Yahoo! FareChase.




-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT 
leemeador.com






       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

Reply via email to