views:

142

answers:

3

How do you develop web services and how do you create WSDL? What do you include in WSDL?

This question is based on observation that developers don't use WSDL properly. WSDL describes the service. I think that service description should include everything needed to use that service. So if I use any WS-* protocol I have to include WS-Policy describing that usage.

I often visit MSDN forum related to WCF - .NET API for creating web services. Almost every day there appear question like: "I have Java secured web service and I need to consume that service in .net client". First answer usually asks for WSDL of that Java web service. Unfortunatelly almost every time WSDL describes only methods and messages. Security information is completely missing => that WSDL does not describe that service because based on information in the WSDL you are not able to consume the service!

What is the situation in Java world? Do you use WS policies? Do you have supporting tools to create WSDL for you if you are not skilled enough to write it? How do you share information about services when one team has to consume services provided by other team?

I have also a questions from other point of view: What problems Java developers have when they have to consume web services created in .NET?

I feel this like a big pain in many projects where different platforms have to communicate over web services. Developers do not share single language (which should be WSDL with policies) and most of the time they are not able to explain what WS-* features they used because it is covered by some API. If we include the fact that only limited set of WS-* features is usually supported in API we have complete mess. Reverse engineering of SOAP message is really time consuming.

+1  A: 

What kind of answer do you exactly expect? A long rant about interoperability issue or the complexity of the web service specifications? Or a confirmation that simple things are indeed interoperable?

Having worked on a project were we had to provide web service written in Java to be consumed in .NET by another team, simple things worked pretty well.

But it starts be get messy as soon as we leave the simple scenario. Security, authentication, MTOM, is a nightmare, at least for from being trivial.

There are a lot of tools and implementations in Javaland. I know that the team behind the Sun Metro stack did a great work and invested lots of effort to also make thing interoperable with Microsoft. I however don't know for other implementations or tools.

I you feel competent to bring your own insight in this wiki answer, feel free: How to write web services in java.

ewernli
Thanks for response, I will definitly check that wiki answer. This question is asking how do you describe your services and why the description is often incomplete? I agree that WS-* specifications are complicated but it is real nightmare when you have to integrate with a services which are not correctly described in WSDL and you don't have working clients to check correct format of SOAP messages.
Ladislav Mrnka
+1  A: 

The Metro stack autogenerates the WSDL for a given web service on demand. Very useful.

Thorbjørn Ravn Andersen
Yes, that is very useful feature. Is it common in Java development tools?
Ladislav Mrnka
Metro is part of Java 6, so yes.
Thorbjørn Ravn Andersen
+1  A: 

Every web service stack I've used, be it Java or .Net auto-generated the WSDL from code. I've heard of some, I think Spring-WS is one in the Java world, that is supposed to generate service code from a WSDL, or what they are calling "contract-first service development", but I haven't used it yet.

mezmo
But do those auto-generated WSDL contain WS-Policies for advanced settings like security, reliable messaging etc. or do they only describe web service methods and transfered messages? That is the point. If you use WS-Security and WSS-UserName token profile, you have to describe it somehow. It is possible by WS-Policy but those information is usually missing in WSDL.
Ladislav Mrnka