3

I am working in a project where we develop some webservices. I was new to the technology, so I didn't really question about some ways of doing. But after some time now, there is still a big question in my mind.

What is the common ways of devising a webservice ?

  • Should java classes be generated from a wsdl contract, with accompanying xsd schemas files ( wsdl and xsd have been discussed between several third parties and us).

  • Should java classes be generated from a wsdl contract without any accompanying xsd schemas files, the types defintions should be included in the wsdl. ( I guess this will become a nightmare for maintenance)

  • Should the wsdl be generated from the java classes that we have designed.

I wonder about this, because at present, we have difficulties to create stubs from the wsdl exposed by our webservices stacked in Axis2. These are the wsdl we provide in META-INF, some really slight modification are made by Axis2, and it's basically the one that was established by/with the third parties.

I wonder: if the wsdl was generated on the contrary from our Java classes, wouldn't it be more logical ?

For example what strikes me also, it's that we cannot have a correct node location

<wsdl:service name="myEntry">
<wsdl:port name="myport_http" binding="ns1:myBinding">
<soap12:address location="our.development.machine.ipaddress">

Since it's provided as META-INF in our .war files, it cannot be in phase with the production machine where the web service will be running. We cannot guess the ip adress of the machines it will run on.

Any advice ? Link to documentation ? Best practices ?

Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
  • 1
    [personal opinion] I have had a lot of troubles using axis and axis2, alone and inside eclipse. Since I could start using jaxws/cxf/spring, developing webservices has become a breeze and I converted from contract-first to code-first (wsdl generated from classes, with beans generated from xsd) – guido Sep 24 '12 at 16:44

0 Answers0