• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Starting with web service

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm novice with web service and I want to build a simple one (hello world) in order to validate the library required and the way it is invoked.
My application server is WAS 5.0.

So I started by downloading axis and here are my question :

1) Axis is a webapp, is it mandatory to create my webservice within this webapp or can I just take a few library?

2) Do I have to call my web service method within an url with the required parameters or can I just call the basic url and attach it a SOAP message containing the name of the method and the parameters?

3) Is it a good thing to start with axis or could I choose another library?

4) Does anyone has a simple example to share with me?

Cheers

Thom
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

1) Axis is a webapp, is it mandatory to create my webservice within this webapp or can I just take a few library?



You can integrate Axis into your own web app. It's just a servlet, after all (that happens to need a lot of supporting libraries).

2) Do I have to call my web service method within an url with the required parameters or can I just call the basic url and attach it a SOAP message containing the name of the method and the parameters?



I'm not quite sure what you're asking. Axis does not support REST-style WS (where parameters are transported in the URL). All methods, parameters and results are transported in the SOAP body of the HTTP request/response.

3) Is it a good thing to start with axis or could I choose another library?



Other WS toolkits are available, but Axis is widely used that you'll find it easier to get answer to your questions, and there are lots more articles and tutorials available for it than for other toolkits.

4) Does anyone has a simple example to share with me?



The WebServicesFaq page links to several start-from-scratch-with-Axis articles (in the "How do I get started building a web service with Axis ?" section). It also links to a plethora of other resources you'll find useful while getting into WS.
 
Thomas Beaujard
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much.
I found a lot of answers in the FAQ.

My question 2 concerns the way my web service is consumed. I want the client to be able to write the whole SOAP message from scratch and then attach to the call to the web service. In the same way I want the web service to be able to construct the SOAP message and send it back.

I hope it is more understandable.

Cheers

Thom
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you want to generate the SOAP/XML without using any SOAP API, and attach it to an HTTP request that you create yourself? That can certainly be done, although I don't really see why one would want to do that. Seems like you'd be reinventing the wheel.
 
Thomas Beaujard
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I don't want to reinvent the wheel, I just want to make sure that any kind of client will be able to call my url and attach it a soap message without using an axis API for example.
I think I need to do a few tutorial to understand a bit more.

Thanks for your help

Thom
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might start by reading this article on WS interoperability, and acquaint yourself with the Web Services Basic Profile, which is all about WS interop.
[ April 24, 2007: Message edited by: Ulf Dittmer ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So you want to generate the SOAP/XML without using any SOAP API, and attach it to an HTTP request that you create yourself? That can certainly be done, although I don't really see why one would want to do that.



For one thing, plugging a few values into a SOAP message template and transmitting using HttpURLConnection is a LOT faster than building a DOM which then has to be serialized for every request.

I looked into this for a client a few years ago - the AXIS wsdl2java tool built a plethora of confusing classes just to create the DOM and parse the returned XML. My solution involved about 1/4 the code and used nothing but standard Java.

Bill
[ April 24, 2007: Message edited by: William Brogden ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic