• Post Reply Bookmark Topic Watch Topic
  • New Topic

Web service proper layout of code files

 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying to create a web service that will generate a ByteArrayOutputStream that I will then convert into a PDF. I have never creted a web service before so I am looking for help on the layout of the project. I have followed several tutorials on creating a web service and they are all quite simple.

I am using this my main example
http://www.softwareagility.gr/index.php?q=node/29

My question here is now that I have a web service up and running where do I add my code?
I plan to remove the method getStatus from the above example and replace it with getByteArray(String id)

I assume that the the getByteArray(String id) should not hold the code to generate the ByteArray but a private method that will. Something like:



So my question is what is the correct way to layout the code for a web service? I have looked for examples but have not been able to find any.

Thanks again
 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be more clear, if I create a webservice using Axis2 would the attached code structure be ok? I can figure how how to code what I need to do I am just confused as to where to put it. In the attached file in the MyService.java I would have the method:



Or should the MyService.java be an Interface which would call another class that would then return the bytearray?

Looking at the Axis Documetation:
http://axis.apache.org/axis2/java/core/docs/xmlbased-server.html
It looks like you can put the business logic methods up front witout an interface and call it directly, is that the correct way to do it?

Thanks again
WebServiceCodeStructure.GIF
[Thumbnail for WebServiceCodeStructure.GIF]
Web Service code structure
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!