What is the difference between ?wsdl and ?singleWsdl parameters
Asked Answered
A

1

30

My messaging provider gives me two different kinds of WSDLs to use.

http://my.amazonaws.com:8000/webservice/?wsdl
http://my.amazonaws.com:8000/webservice/?singleWsdl

The first one is an embedded WSDL. Can NOT use it to generate WSDL2java packages and can NOT use JAX-WS to create a connection.

The second one is a single WSDL. It can generate Java packages with CXF 3.0's WSDL2java and can use JAX-WS to create a connection. It works very well.

Please let me know what is the difference between these two kinds of WSDLs.

Anhinga answered 13/8, 2014 at 3:26 Comment(0)
T
42

Without knowing what those links return we can only guess, but here are some details that might help you....

Suffixing the web service endpoint with ?wsdl get's you a WSDL file. The WSDL can be generated by the framework at runtime based on the web service skeleton code or can be an actual physical file that the server just sends back when the URL parameter is specified.

The WSDL contains an XML Schema that can be specified either inside the WSDL itself or as separate files that are imported by the WSDL. And now a problem occurs...

Some web service stub generators can only handle a full WSDL, with the Schema inside. If the WSDL imports other files the tools can't resolve the imports and fails. This made web services hard to consume because clients had issues creating stubs to interact with the web service. So much so that service providers either used an actual WSDL to respond to the ?wsdl request or started writing all sorts of hacks and plugins to make the web service generate the full WSDL.

But some providers didn't even bother so clients had to write the hacks to parse the WSDL or they had to download all files, assemble them manually into a single file and use that instead.

With time people recognized this as a problem and frameworks adapted to provide the full WSDL, not one with imports. But this generated another problem. Changing what the ?wsdl URL returned could break all those hacks created around it to fix the import problem. For this reason another convention was chosen to return the full WSDL: ?singleWsdl.

So there are frameworks that generate a full WSDL, some that generate it with imports, some allow you to specify an actual physical file, some that support the ?singleWsdl convention, some that don't. Not relevant to this question, but just for completion, there is also a ?wsdl2 convention that get's you a WSDL 2.0 definition (?wsdl get you a WSDL 1.1). Some frameworks support ?wsdl2, some don't.

My guess is the issues you have are caused by Schema imports, but without the WSDLs themselves I can't tell. Hope at least that these details help you better identify the problem.

Tallowy answered 15/8, 2014 at 13:38 Comment(3)
Am I wrong or one should assume, based on this answer, that ?singleWsdl is to be the preferred choice ?Paleolithic
@Veverke: when service and client use the same technological stack it most of the time does not matter (e.g. svcutil can handle any form of WSDL content for a WCF service). When going cross technologies the ?singleWsdl option is the safest to use (assuming the service supports it)Tallowy
@Bogdan: Mate you absolutely don't need to know what those URLs have to answer this query. It is the same question for me too, singlewsdl works while wsdl doesn't work for my WCF Service when consumed by one of our client. Your answer although accepted, is coward enough in the start as it is about the concept, not what is inside. You can pick up a small wcf service and you will have same too (From version 4.5), and you can explain, mateOily

© 2022 - 2024 — McMap. All rights reserved.