File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes starting web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "starting web service" Watch "starting web service" New topic
Author

starting web service

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
I'm quite new to web service, and I'd like to create a simple one. I'm given an XML file detailing the objects to send as parameter like so:


while I know typical SOAP request will need to have the POST header, envelope, header, body etc. So I'm wondering what to do with the given xml above? do I wrap the xml in the SOAP request, or upload the xml or what?
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

You could convert it to WSDL format, then build your server and client(s) around that.

If the clients cannot change the XML format, then you may have to wrap in CDATA,
and unmarshall yourself using jaxb or something.

It all depends on the restrictions enforced by your application infrastructure.


WP
Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
I wish to make the client to be web based, should I do this with top down or bottom up approach? or it doesn't matter? both works just fine? I also wish to use apache axis2 or cxf. which is more recommended?
I created the service server using dynamic web project with bottom up approach (eclipse indigo and axis2). Right now, there's only one class (MyService.java) containing one public method:


1. how do I create the web-based client? do I make a separate project? if so, what's the type of the project? maven, javaEE, dynamic web?
2. also as I mentioned above, the soap request will contain the xml that will be most likely to later be parsed into a Java object. I assume that the POJO definition will be in the web service server project?
3. what's the naming convention for the classes and packages in web service project (both the server and client project)?
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: starting web service