• 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

Need some explanations about web-services basics.

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gentlemen, please clarify some points in web-services basics. Am I right?

As far as I understand:

1) web-service is some application that accepts HTTP GET or POST requests. In fact, each servlet is a production-ready web-service.

2) the only thing we need to interact with the web-service is a code that sends HTTP requests. Actually we can write web-service client without AXIS or JAX libraries.

3) the purpose of AXIS and JAX libraries is to make it possible for a programmer to interact with Java classes and methods, and not XML strings in his application.

4) ok, but anyway, if I dont want to use any web-service frameworks, or may be I just want to make a quick and dirty test of a web-service and my credentioals, for example, how can I create a correct HTTP POST or GET request basing on WSDL file? Whats exactly should I do? Copy some part of WSDL to request header or data and send it, or make some modifications to WSDL XML?

5) could you please clarify main differences between AXIS and JAX? which one is preferrable? Does it depend on WSDL provided or not?
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dmirty,

I'd like to be as brief as possible to try to answer your questions.

1. Yes, but web service is more than that. Restful web services use HTTP PUT and DELETE methods as well.

2. Not necessarily HTTP requests. You can also use JMS/MQ/SMTP etc. as transport protocols. Having said that majority of web services use HTTP as transport. You need web service API to create client. If you are referring JDK 6, then it has got JAX-WS API.

3. Right to some extent. Unless you have some data binding API like XMLBeans, JAXB, etc. used along with web services API, XML strings can't be unmarshalled to Java objects and vice-versa.

4.

Copy some part of WSDL to request header or data and send it, or make some modifications to WSDL XML?


I don't quite understand what you mean here. WSDL is used to generate test client(using some web service API, so you have to use web service framework) if you want to create test web service.

5. All web service frameworks(REST excluded) require WSDL. You can get many articles on various web services comparisons, if you search in your favourite search engine. It's a huge topic in itself to explain in few lines.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dmitry Zhuravlev wrote:1) web-service is some application that accepts HTTP GET or POST requests. In fact, each servlet is a production-ready web-service.


I really wouldn't call all servlets web services - those are generally based on SOAP or REST, and that's not true for servlets in general.

5) could you please clarify main differences between AXIS and JAX? which one is preferrable? Does it depend on WSDL provided or not?


By "JAX", I assume you mean JAX-WS, or rather, its reference implementation that forms the core of the Metro project. Note that JAX-WS (and JAX-RS) are APIs, while Axis and Metro are implementations; both support JAX-WS and WSDL (and some other features like SAAJ and WS-Security). Both are popular, both are capable, so there's no easy choice between the two.


Naren Chivukula wrote:2. You need web service API to create client.


No, especially for RESTful services using just the HttpUrlConnection class, or the HttpClient library, works fine.

5. All web service frameworks (REST excluded) require WSDL.


Well, all major SOAP implementations support WSDL, but that's certainly not required to implement SOAP services. Having said that, it is generally accepted practice to supply the WSDL of a service along with the service, so that it's easier to build clients.
 
Dmitry Zhuravlev
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,
thank you for the explanations.

One thing remains unclear for me. I will try to explain in other words.

If the majoruty of web-services accepts HTTP POST or GET requests as input data, then why can't I create a web-service client which sends HTTP POST requests and accepts its response? It looks very simple, I would not need any frameworks for this.
Will this work?

If no - why?
If yes - in which form should I pass some parameters into my POST request? I mean how should I encode method name, method namespace, method parameters in POST body or POST header?
 
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
Sure, you can implement a web service without resorting to any framework, but why would you? The frameworks do a lot of work for you, like all the things you're asking about in the "If yes - ..." part, and then some. There's no good reason to duplicate all the work of reinventing the wheel.
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Well, all major SOAP implementations support WSDL, but that's certainly not required to implement SOAP services. Having said that, it is generally accepted practice to supply the WSDL of a service along with the service, so that it's easier to build clients.


Agree with Ulf. SAAJ is one such API, which doesn't need to have WSDL to invoke web services. Having said that, the details which we require to build SAAJ message come from usually WSDL if not verbally from someone
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic