• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programming web services with JAX WS approach

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am planning to write a web service based on jax ws .

My basic requirement is that , i need to accept a District or Region name as my Text Input , and in return i need to return all the names of the people of that for that Particular Organization .

I am having a query here , i am using EJB 3.0 Session Beans as my service End Point , please tell me can i store the contents in a ArrayList and return that ??

Please share your ideas . Thank you .
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
As have been said here before, it is better to return an array of items from a method in a web service endpoint implementation class, since it is easier to represent an array in XML.
Best wishes!
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much .
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
As i said , i am trying to return all the Peoples data of that region by returning an Object Array as you mentioned .
(An Array consisting all the People details).

This is my sample code of it .
All this is inside my EJB Implementation code


This is the way i am going to implement , please suggest me if there is anything wrong , as i have seen some code which is making use of @WebResult and i am not making use of it .

Please tell me whether using any @WebResult is necessary ??

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I suggest that you return an array of Customer, instead of an array of Object.
If you are doing java-first development, then I suspect that there is no reason for using @WebResult, since, at development time, you have neither WSDL nor associated XML schemas.
If you are not happy with the default result of compiling the Java bean class Customer to an XML schema performed by JAX-WS, you may want to consider using JAXB annotations in the Customer class.
Best wishes!
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you very much .
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic